llvm-6502/lib/Transforms/Scalar
Chandler Carruth 4f9a7277d1 [SROA] Apply a somewhat heavy and unpleasant hammer to fix PR22093, an
assert out of the new pre-splitting in SROA.

This fix makes the code do what was originally intended -- when we have
a store of a load both dealing in the same alloca, we force them to both
be pre-split with identical offsets. This is really quite hard to do
because we can keep discovering problems as we go along. We have to
track every load over the current alloca which for any resaon becomes
invalid for pre-splitting, and go back to remove all stores of those
loads. I've included a couple of test cases derived from PR22093 that
cover the different ways this can happen. While that PR only really
triggered the first of these two, its the same fundamental issue.

The other challenge here is documented in a FIXME now. We end up being
quite a bit more aggressive for pre-splitting when loads and stores
don't refer to the same alloca. This aggressiveness comes at the cost of
introducing potentially redundant loads. It isn't clear that this is the
right balance. It might be considerably better to require that we only
do pre-splitting when we can presplit every load and store involved in
the entire operation. That would give more consistent if conservative
results. Unfortunately, it requires a non-trivial change to the actual
pre-splitting operation in order to correctly handle cases where we end
up pre-splitting stores out-of-order. And it isn't 100% clear that this
is the right direction, although I'm starting to suspect that it is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-05 04:17:53 +00:00
..
ADCE.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
AlignmentFromAssumptions.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
CMakeLists.txt
ConstantHoisting.cpp
ConstantProp.cpp
CorrelatedValuePropagation.cpp
DCE.cpp
DeadStoreElimination.cpp
EarlyCSE.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
FlattenCFGPass.cpp
GVN.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
IndVarSimplify.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
JumpThreading.cpp Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite 2014-11-25 08:20:27 +00:00
LICM.cpp Refine the notion of MayThrow in LICM to include a header specific version 2014-12-29 23:00:57 +00:00
LLVMBuild.txt
LoadCombine.cpp
LoopDeletion.cpp
LoopIdiomRecognize.cpp
LoopInstSimplify.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
LoopRerollPass.cpp
LoopRotation.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
LoopStrengthReduce.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
LoopUnrollPass.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
LoopUnswitch.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
LowerAtomic.cpp
Makefile
MemCpyOptimizer.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
MergedLoadStoreMotion.cpp Sink store based on alias analysis 2014-12-15 14:09:53 +00:00
PartiallyInlineLibCalls.cpp
Reassociate.cpp [Reassociate] Use dbgs() instead of errs(). 2014-12-12 14:44:12 +00:00
Reg2Mem.cpp
SampleProfile.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
Scalar.cpp
Scalarizer.cpp
ScalarReplAggregates.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
SCCP.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
SeparateConstOffsetFromGEP.cpp
SimplifyCFGPass.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
Sink.cpp
SROA.cpp [SROA] Apply a somewhat heavy and unpleasant hammer to fix PR22093, an 2015-01-05 04:17:53 +00:00
StructurizeCFG.cpp StructurizeCFG: Use LoopInfo analysis for better loop detection 2014-12-03 04:28:32 +00:00
TailRecursionElimination.cpp Fix tail recursion elimination 2014-11-19 13:32:51 +00:00