mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
d565552917
This patch removes the function `expandSCEVIfNeeded` which behaves not as it was intended. This function tries to make a lookup for exact existing expansion and only goes to normal expansion via `expandCodeFor` if this lookup hasn't found anything. As a result of this, if some instruction above the loop has a `SCEVConstant` SCEV, this logic will return this instruction when asked for this `SCEVConstant` rather than return a constant value. This is both non-profitable and in some cases leads to breach of LCSSA form (as in PR38674). Whether or not it is possible to break LCSSA with this algorithm and with some non-constant SCEVs is still in question, this is still being investigated. I wasn't able to construct such a test so far, so maybe this situation is impossible. If it is, it will go as a separate fix. Rather than do it, it is always correct to just invoke `expandCodeFor` unconditionally: it behaves smarter about insertion points, and as side effect of this it will choose a constant value for SCEVConstants. For other SCEVs it may end up finding a better insertion point. So it should not be worse in any case. NOTE: So far the only known case for which this transform may break LCSSA is mapping of SCEVConstant to an instruction. However there is a suspicion that the entire algorithm can compromise LCSSA form for other cases as well (yet not proved). Differential Revision: https://reviews.llvm.org/D51286 Reviewed By: etherzhhb llvm-svn: 341345 |
||
---|---|---|
.. | ||
ADCE | ||
AddDiscriminators | ||
AggressiveInstCombine | ||
AlignmentFromAssumptions | ||
ArgumentPromotion | ||
AtomicExpand | ||
BDCE | ||
BlockExtractor | ||
BranchFolding | ||
CalledValuePropagation | ||
CallSiteSplitting | ||
CodeExtractor | ||
CodeGenPrepare | ||
ConstantHoisting | ||
ConstantMerge | ||
ConstProp | ||
Coroutines | ||
CorrelatedValuePropagation | ||
CrossDSOCFI | ||
DCE | ||
DeadArgElim | ||
DeadStoreElimination | ||
DivRemPairs | ||
EarlyCSE | ||
EliminateAvailableExternally | ||
EntryExitInstrumenter | ||
ExpandMemCmp/X86 | ||
Float2Int | ||
ForcedFunctionAttrs | ||
FunctionAttrs | ||
FunctionImport | ||
GCOVProfiling | ||
GlobalDCE | ||
GlobalMerge | ||
GlobalOpt | ||
GlobalSplit | ||
GuardWidening | ||
GVN | ||
GVNHoist | ||
GVNSink | ||
IndirectBrExpand | ||
IndVarSimplify | ||
InferAddressSpaces | ||
InferFunctionAttrs | ||
Inline | ||
InstCombine | ||
InstMerge | ||
InstNamer | ||
InstSimplify | ||
InterleavedAccess | ||
Internalize | ||
IPConstantProp | ||
IRCE | ||
JumpThreading | ||
LCSSA | ||
LICM | ||
LoadStoreVectorizer | ||
LoopDataPrefetch | ||
LoopDeletion | ||
LoopDistribute | ||
LoopIdiom | ||
LoopInstSimplify | ||
LoopInterchange | ||
LoopLoadElim | ||
LoopPredication | ||
LoopReroll | ||
LoopRotate | ||
LoopSimplify | ||
LoopSimplifyCFG | ||
LoopStrengthReduce | ||
LoopUnroll | ||
LoopUnrollAndJam | ||
LoopUnswitch | ||
LoopVectorize | ||
LoopVersioning | ||
LoopVersioningLICM | ||
LowerAtomic | ||
LowerExpectIntrinsic | ||
LowerGuardIntrinsic | ||
LowerInvoke | ||
LowerSwitch | ||
LowerTypeTests | ||
Mem2Reg | ||
MemCpyOpt | ||
MergeFunc | ||
MergeICmps | ||
MetaRenamer | ||
NameAnonGlobals | ||
NaryReassociate | ||
NewGVN | ||
ObjCARC | ||
PartiallyInlineLibCalls | ||
PGOProfile | ||
PhaseOrdering | ||
PlaceSafepoints | ||
PreISelIntrinsicLowering | ||
PruneEH | ||
Reassociate | ||
Reg2Mem | ||
RewriteStatepointsForGC | ||
SafeStack | ||
SampleProfile | ||
Scalarizer | ||
SCCP | ||
SeparateConstOffsetFromGEP | ||
SimpleLoopUnswitch | ||
SimplifyCFG | ||
Sink | ||
SLPVectorizer | ||
SpeculateAroundPHIs | ||
SpeculativeExecution | ||
SROA | ||
StraightLineStrengthReduce | ||
StripDeadPrototypes | ||
StripSymbols | ||
StructurizeCFG | ||
SyntheticCountsPropagation | ||
TailCallElim | ||
ThinLTOBitcodeWriter | ||
Util | ||
WholeProgramDevirt |