llvm-project/llvm/lib/Transforms/Scalar
Chandler Carruth cd7c8cdfa1 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.

llvm-svn: 187347
2013-07-29 09:06:53 +00:00
..
ADCE.cpp Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. 2013-07-04 01:31:24 +00:00
BasicBlockPlacement.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
CMakeLists.txt Remove the simplify-libcalls pass (finally) 2013-06-20 19:48:07 +00:00
CodeGenPrepare.cpp Remove trailing whitespace 2013-07-15 17:55:02 +00:00
ConstantProp.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
CorrelatedValuePropagation.cpp CVP: If we have a PHI with an incoming select, try to skip the select. 2013-02-24 15:34:43 +00:00
DCE.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
DeadStoreElimination.cpp Change GetPointerBaseWithConstantOffset's DataLayout argument from a 2013-01-31 02:00:45 +00:00
EarlyCSE.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
GVN.cpp Reimplement isPotentiallyReachable to make nocapture deduction much stronger. 2013-07-27 01:24:00 +00:00
GlobalMerge.cpp Change tabs to spaces. 2013-07-22 21:11:30 +00:00
IndVarSimplify.cpp LFTR improvement to avoid truncation. 2013-07-12 22:08:48 +00:00
JumpThreading.cpp Reimplement isPotentiallyReachable to make nocapture deduction much stronger. 2013-07-27 01:24:00 +00:00
LICM.cpp LICM: Hoist insertvalue/extractvalue out of loops. 2013-01-09 18:12:03 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
LoopDeletion.cpp Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size. 2013-07-14 04:42:23 +00:00
LoopIdiomRecognize.cpp Fix spelling and grammar 2013-07-22 18:59:58 +00:00
LoopInstSimplify.cpp Remove #includes from the commonly used LoopInfo.h. 2013-02-09 01:04:28 +00:00
LoopRotation.cpp Rotate multi-exit loops even if the latch was simplified. 2013-05-06 17:58:18 +00:00
LoopStrengthReduce.cpp LSR: Fix the parameters used to compute the scaling factor cost. 2013-06-19 19:59:41 +00:00
LoopUnrollPass.cpp Switch CodeMetrics itself over to use TTI to determine if an instruction 2013-01-21 13:04:33 +00:00
LoopUnswitch.cpp Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size. 2013-07-14 04:42:23 +00:00
LowerAtomic.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
Makefile
MemCpyOptimizer.cpp Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. 2013-07-03 15:07:05 +00:00
Reassociate.cpp Use switch instead of if. No functionality change. 2013-07-22 23:38:16 +00:00
Reg2Mem.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
SCCP.cpp Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size. 2013-07-14 04:42:23 +00:00
SROA.cpp Teach the AllocaPromoter which is wrapped around the SSAUpdater 2013-07-29 09:06:53 +00:00
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
SimplifyCFGPass.cpp SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions 2013-07-27 00:01:07 +00:00
Sink.cpp Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
StructurizeCFG.cpp Add 'const' qualifiers to static const char* variables. 2013-07-16 01:17:10 +00:00
TailRecursionElimination.cpp TRE: Move class into anonymous namespace. 2013-07-24 16:12:08 +00:00