llvm-6502/lib/Transforms/Scalar
Chandler Carruth e1361ec325 Teach the AllocaPromoter which is wrapped around the SSAUpdater
infrastructure to do promotion without a domtree the same smarts about
looking through GEPs, bitcasts, etc., that I just taught mem2reg about.
This way, if SROA chooses to promote an alloca which still has some
noisy instructions this code can cope with them.

I've not used as principled of an approach here for two reasons:
1) This code doesn't really need it as we were already set up to zip
   through the instructions used by the alloca.
2) I view the code here as more of a hack, and hopefully a temporary one.

The SSAUpdater path in SROA is a real sore point for me. It doesn't make
a lot of architectural sense for many reasons:
- We're likely to end up needing the domtree anyways in a subsequent
  pass, so why not compute it earlier and use it.
- In the future we'll likely end up needing the domtree for parts of the
  inliner itself.
- If we need to we could teach the inliner to preserve the domtree. Part
  of the re-work of the pass manager will allow this to be very powerful
  even in large SCCs with many functions.
- Ultimately, computing a domtree has gotten significantly faster since
  the original SSAUpdater-using code went into ScalarRepl. We no longer
  use domfrontiers, and much of domtree is lazily done based on queries
  rather than eagerly.
- At this point keeping the SSAUpdater-based promotion saves a total of
  0.7% on a build of the 'opt' tool for me. That's not a lot of
  performance given the complexity!

So I'm leaving this a bit ugly in the hope that eventually we just
remove all of this nonsense.

I can't even readily test this because this code isn't reachable except
through SROA. When I re-instate the patch that fast-tracks allocas
already suitable for promotion, I'll add a testcase there that failed
before this change. Before that, SROA will fix any test case I give it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187347 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 09:06:53 +00:00
..
ADCE.cpp
BasicBlockPlacement.cpp
CMakeLists.txt
CodeGenPrepare.cpp
ConstantProp.cpp
CorrelatedValuePropagation.cpp
DCE.cpp
DeadStoreElimination.cpp
EarlyCSE.cpp
GlobalMerge.cpp Change tabs to spaces. 2013-07-22 21:11:30 +00:00
GVN.cpp Reimplement isPotentiallyReachable to make nocapture deduction much stronger. 2013-07-27 01:24:00 +00:00
IndVarSimplify.cpp
JumpThreading.cpp Reimplement isPotentiallyReachable to make nocapture deduction much stronger. 2013-07-27 01:24:00 +00:00
LICM.cpp
LLVMBuild.txt
LoopDeletion.cpp
LoopIdiomRecognize.cpp Fix spelling and grammar 2013-07-22 18:59:58 +00:00
LoopInstSimplify.cpp
LoopRotation.cpp
LoopStrengthReduce.cpp
LoopUnrollPass.cpp
LoopUnswitch.cpp
LowerAtomic.cpp
Makefile
MemCpyOptimizer.cpp
Reassociate.cpp Use switch instead of if. No functionality change. 2013-07-22 23:38:16 +00:00
Reg2Mem.cpp
Scalar.cpp SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions 2013-07-27 00:01:07 +00:00
ScalarReplAggregates.cpp Thread DataLayout through the callers and into mem2reg. This will be 2013-07-28 06:43:11 +00:00
SCCP.cpp
SimplifyCFGPass.cpp SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions 2013-07-27 00:01:07 +00:00
Sink.cpp
SROA.cpp Teach the AllocaPromoter which is wrapped around the SSAUpdater 2013-07-29 09:06:53 +00:00
StructurizeCFG.cpp
TailRecursionElimination.cpp TRE: Move class into anonymous namespace. 2013-07-24 16:12:08 +00:00