llvm-6502/lib
Chandler Carruth 77c1270033 Refactor the PartitionUse structure to actually use the Use* instead of
a pair of instructions, one for the used pointer and the second for the
user. This simplifies the representation and also makes it more dense.

This was noticed because of the miscompile in PR13926. In that case, we
were running up against a fundamental "bad idea" in the speculation of
PHI and select instructions: the speculation and rewriting are
interleaved, which requires phi speculation to also perform load
rewriting! This is bad, and causes us to miss opportunities to do (for
example) vector rewriting only exposed after PHI speculation, etc etc.
It also, in the old system, required us to insert *new* load uses into
the current partition's use list, which would then be ignored during
rewriting because we had already extracted an end iterator for the use
list. The appending behavior (and much of the other oddities) stem from
the strange de-duplication strategy in the PartitionUse builder.
Amusingly, all this went without notice for so long because it could
only be triggered by having *different* GEPs into the same partition of
the same alloca, where both different GEPs were operands of a single
PHI, and where the GEP which was not encountered first also had multiple
uses within that same PHI node... Hence the insane steps required to
reproduce.

So, step one in fixing this fundamental bad idea is to make the
PartitionUse actually contain a Use*, and to make the builder do proper
deduplication instead of funky de-duplication. This is enough to remove
the appending behavior, and fix the miscompile in PR13926, but there is
more work to be done here. Subsequent commits will lift the speculation
into its own visitor. It'll be a useful step toward potentially
extracting all of the speculation logic into a generic utility
transform.

The existing PHI test case for repeated operands has been made more
extreme to catch even these issues. This test case, run through the old
pass, will exactly reproduce the miscompile from PR13926. ;] We were so
close here!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164925 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01 01:49:22 +00:00
..
Analysis Ignore apparent buffer overruns on external or weak globals. This is a major 2012-09-30 07:30:10 +00:00
Archive Mark checkSignature const, and in turn stop casting away const from 2012-09-05 22:09:23 +00:00
AsmParser Don't use bit-wise operations to query for inclusion/exclusion of attributes. 2012-09-28 22:30:18 +00:00
Bitcode Move remaining methods inside the Attributes class. Merge the 'Attribute' namespaces. 2012-09-25 20:57:48 +00:00
CodeGen Use dyn_cast instead of isa and cast. 2012-09-30 21:24:57 +00:00
DebugInfo Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-18 02:01:41 +00:00
ExecutionEngine Removing dependency on third party library for Intel JIT event support. 2012-09-28 17:35:20 +00:00
Linker Move the "findUsedStructTypes" functionality outside of the Module class. 2012-08-03 00:30:35 +00:00
MC Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 2012-09-27 10:14:43 +00:00
Object Reverting r 160419. 2012-07-19 21:43:55 +00:00
Support Replace the use of strncpy() and sprintf() with std::string and LLVM streams. 2012-09-28 14:15:28 +00:00
TableGen De-nest if's and fix mix-up 2012-09-19 02:14:59 +00:00
Target Change getX86SubSuperRegister to take an MVT::SimpleValueType rather than an EVT and add llvm_unreachable to the switches. Helps it compile to dramatically better code. 2012-09-30 19:49:56 +00:00
Transforms Refactor the PartitionUse structure to actually use the Use* instead of 2012-10-01 01:49:22 +00:00
VMCore Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 2012-09-27 10:14:43 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile