llvm-6502/test/Transforms
Chandler Carruth 8d93d41027 Re-implement the analysis of uses in mem2reg to be significantly more
robust. It now uses an InstVisitor and worklist to actually walk the
uses of the Alloca transitively and detect the pattern which we can
directly promote: loads & stores of the whole alloca and instructions we
can completely ignore.

Also, with this new implementation teach both the predicate for testing
whether we can promote and the promotion engine itself to use the same
code so we no longer have strange divergence between the two code paths.

I've added some silly test cases to demonstrate that we can handle
slightly more degenerate code patterns now. See the below for why this
is even interesting.

Performance impact: roughly 1% regression in the performance of SROA or
ScalarRepl on a large C++-ish test case where most of the allocas are
basically ready for promotion. The reason is because of silly redundant
work that I've left FIXMEs for and which I'll address in the next
commit. I wanted to separate this commit as it changes the behavior.
Once the redundant work in removing the dead uses of the alloca is
fixed, this code appears to be faster than the old version. =]

So why is this useful? Because the previous requirement for promotion
required a *specific* visit pattern of the uses of the alloca to verify:
we *had* to look for no more than 1 intervening use. The end goal is to
have SROA automatically detect when an alloca is already promotable and
directly hand it to the mem2reg machinery rather than trying to
partition and rewrite it. This is a 25% or more performance improvement
for SROA, and a significant chunk of the delta between it and
ScalarRepl. To get there, we need to make mem2reg actually capable of
promoting allocas which *look* promotable to SROA without have SROA do
tons of work to massage the code into just the right form.

This is actually the tip of the iceberg. There are tremendous potential
savings we can realize here by de-duplicating work between mem2reg and
SROA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187191 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 08:20:39 +00:00
..
ADCE
ArgumentPromotion Update some EH tests that were violating the new EH model. 2013-03-21 18:30:10 +00:00
BBVectorize Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
BlockPlacement
BranchFolding
CodeExtractor
CodeGenPrepare Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
ConstantMerge Fix const merging when an alias of a const is llvm.used. 2013-05-06 01:48:55 +00:00
ConstProp Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
CorrelatedValuePropagation Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
DeadArgElim Current batch of -disable-debug-info-verifier. 2013-07-25 17:16:05 +00:00
DeadStoreElimination Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
DebugIR Adding tests for DebugIR pass 2013-06-28 20:37:20 +00:00
EarlyCSE Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
FunctionAttrs Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
GCOVProfiling Revert "Revert "PR14606: debug info imported_module support"" 2013-04-22 06:12:31 +00:00
GlobalDCE Revert 179826. Tests were worthless. 2013-04-19 09:32:30 +00:00
GlobalOpt Debug Info: improve the verifier to check field types. 2013-07-25 19:33:30 +00:00
GVN Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
IndVarSimplify Teach indvars to generate nsw/nuw flags when widening an induction variable. 2013-07-14 02:50:07 +00:00
Inline Have InlineCost check constant fcmps 2013-07-20 04:09:00 +00:00
InstCombine Current batch of -disable-debug-info-verifier. 2013-07-25 17:16:05 +00:00
InstSimplify Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
Internalize Respect llvm.used in Internalize. 2013-07-25 03:23:25 +00:00
IPConstantProp Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
JumpThreading Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
LCSSA Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
LICM Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
LoopDeletion Modify the LLVM assembly output so that it uses references to represent function attributes. 2013-02-20 07:21:42 +00:00
LoopIdiom add -disable-debug-info-verifier to 3 test to fix tests with pipefail. 2013-07-24 18:44:10 +00:00
LoopRotate Update testing cases to pass debug info verifier. 2013-07-24 22:23:00 +00:00
LoopSimplify Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
LoopStrengthReduce Allocate local registers in order for optimal coloring. 2013-07-25 18:35:14 +00:00
LoopUnroll Fixup to r186268 and r186269: don't append -LABEL to CHECK-NOT. No functionality change. 2013-07-14 02:10:57 +00:00
LoopUnswitch Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
LoopVectorize Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
LowerAtomic Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
LowerExpectIntrinsic Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
LowerInvoke
LowerSwitch
Mem2Reg Re-implement the analysis of uses in mem2reg to be significantly more 2013-07-26 08:20:39 +00:00
MemCpyOpt Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
MergeFunc TBAA: remove !tbaa from testing cases if not used. 2013-04-30 17:52:57 +00:00
MetaRenamer Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID 2013-01-01 13:57:25 +00:00
ObjCARC Update testing cases to pass debug info verifier. 2013-07-24 22:23:00 +00:00
PhaseOrdering Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
PruneEH The normal edge of an invoke is not allowed to branch to a block with a 2012-08-10 20:55:20 +00:00
Reassociate Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
Reg2Mem Make sure we don't emit instructions before a landingpad instruction. 2013-01-08 10:51:32 +00:00
ScalarRepl Current batch of -disable-debug-info-verifier. 2013-07-25 17:16:05 +00:00
SCCP Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
SimplifyCFG add -disable-debug-info-verifier to 3 test to fix tests with pipefail. 2013-07-24 18:44:10 +00:00
Sink Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change. 2013-07-14 01:42:54 +00:00
SLPVectorizer When we vectorize across multiple basic blocks we may vectorize PHINodes that create a cycle. We already break the cycle on phi-nodes, but arithmetic operations are still uplicated. This patch adds code that checks if the operation that we are vectorizing was vectorized during the visit of the operands and uses this value if it can. 2013-07-22 22:18:07 +00:00
SROA Fix a problem I introduced in r187029 where we would over-eagerly 2013-07-24 12:12:17 +00:00
StripSymbols Debug Info: improve the verifier to check field types. 2013-07-25 19:33:30 +00:00
StructurizeCFG Move StructurizeCFG out of R600 to generic Transforms. 2013-06-19 20:18:24 +00:00
TailCallElim Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change. 2013-07-14 01:50:49 +00:00
TailDup Revert the test moves from 176733. Use "REQUIRES: asserts" instead. 2013-03-12 16:27:52 +00:00