llvm-project/llvm/lib/Transforms/Scalar
Leo Li 20fbad9307 [ConstantHoisting] Avoid hoisting constants in GEPs that index into a struct type.
Summary:
Indices for GEPs that index into a struct type should always be
constants. This added more checks in `collectConstantCandidates:` which make
sure constants for GEP pointer type are not hoisted.

This fixed Bug https://bugs.llvm.org/show_bug.cgi?id=33538

Reviewers: ributzka, rnk

Reviewed By: ributzka

Subscribers: efriedma, llvm-commits, srhines, javed.absar, pirama

Differential Revision: https://reviews.llvm.org/D34576

llvm-svn: 306704
2017-06-29 17:03:34 +00:00
..
ADCE.cpp [ADCE] Remove redundent code [NFC] 2017-03-16 03:59:23 +00:00
AlignmentFromAssumptions.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
BDCE.cpp [PM] Introduce an analysis set used to preserve all analyses over 2017-01-15 06:32:49 +00:00
CMakeLists.txt Remove the LoadCombine pass. It was never enabled and is unsupported. 2017-06-22 22:58:12 +00:00
ConstantHoisting.cpp [ConstantHoisting] Avoid hoisting constants in GEPs that index into a struct type. 2017-06-29 17:03:34 +00:00
ConstantProp.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
CorrelatedValuePropagation.cpp [CorrelatedValuePropagation] Fix typo in comment sense->since. NFC 2017-06-23 20:28:40 +00:00
DCE.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DeadStoreElimination.cpp Cleanup in preparation for D30703. NFCI 2017-03-29 14:42:27 +00:00
EarlyCSE.cpp [EarlyCSE] Make PhiToCheck in removeMSSA() a set. 2017-06-14 19:29:53 +00:00
FlattenCFGPass.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Float2Int.cpp [Float2Int] Replace a ConstantRange copy with a move. Remove an extra call to MapVector::find. 2017-05-05 17:09:29 +00:00
GVN.cpp [GVN] Recommit the patch "Add phi-translate support in scalarpre". 2017-06-26 18:16:10 +00:00
GVNHoist.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
GVNSink.cpp Hide dbgs() stream for when built with -fmodules. 2017-06-14 19:16:22 +00:00
GuardWidening.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
IVUsersPrinter.cpp
IndVarSimplify.cpp [IndVars] Add an option to be able to disable LFTR 2017-06-09 06:11:59 +00:00
InductiveRangeCheckElimination.cpp [IRCE][NFC] Better get SCEV for 1 in calculateSubRanges 2017-06-28 04:57:45 +00:00
InferAddressSpaces.cpp InferAddressSpaces: Avoid assertion failure with replacing identical 2017-06-08 13:20:55 +00:00
JumpThreading.cpp [JumpThreading] Teach jump threading how to analyze (and (cmp A, C1), (cmp A, C2)) after InstCombine has turned it into (cmp (add A, C3), C4) 2017-06-23 05:41:35 +00:00
LICM.cpp [IR] Prefer use_empty() to !hasNUsesOrMore(1) for clarity. 2017-05-16 22:38:40 +00:00
LLVMBuild.txt
LoopAccessAnalysisPrinter.cpp
LoopDataPrefetch.cpp
LoopDeletion.cpp [LoopDeletion] NFC: Move phi node value setting into prepass 2017-06-25 21:13:58 +00:00
LoopDistribute.cpp Add a wrapper around copy_if in STLExtras; NFC 2017-02-21 00:38:44 +00:00
LoopIdiomRecognize.cpp [Atomics] Rename and change prototype for atomic memcpy intrinsic 2017-06-16 14:43:59 +00:00
LoopInstSimplify.cpp Kill off the old SimplifyInstruction API by converting remaining users. 2017-04-28 19:55:38 +00:00
LoopInterchange.cpp Remove inclusion of SSAUpdater from several passes. 2017-01-29 01:55:24 +00:00
LoopLoadElimination.cpp Add a getPointerOperandType() helper to LoadInst and StoreInst; NFC 2017-04-18 22:00:54 +00:00
LoopPassManager.cpp [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
LoopPredication.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
LoopRerollPass.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
LoopRotation.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
LoopSimplifyCFG.cpp Rename WeakVH to WeakTrackingVH; NFC 2017-05-01 17:07:49 +00:00
LoopSink.cpp [PM] Port LoopSink to the new pass manager. 2017-01-20 08:42:19 +00:00
LoopStrengthReduce.cpp Revert r304824 "Fix PR23384 (part 3 of 3)" 2017-06-19 17:57:15 +00:00
LoopUnrollPass.cpp [LoopUnroll] Fix bug in computeUnrollCount causing it to not honor MaxCount 2017-06-28 17:01:15 +00:00
LoopUnswitch.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
LoopVersioningLICM.cpp
LowerAtomic.cpp
LowerExpectIntrinsic.cpp Fix builin_expect lowering bug 2017-06-07 18:32:24 +00:00
LowerGuardIntrinsic.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MemCpyOptimizer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MergedLoadStoreMotion.cpp Remove inclusion of SSAUpdater from several passes. 2017-01-29 01:55:24 +00:00
NaryReassociate.cpp Rename WeakVH to WeakTrackingVH; NFC 2017-05-01 17:07:49 +00:00
NewGVN.cpp NewGVN: Remove useless test in addPhiOfOps. 2017-06-29 17:01:10 +00:00
PartiallyInlineLibCalls.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
PlaceSafepoints.cpp
Reassociate.cpp [Reassociate] Make sure EraseInst sets MadeChange 2017-06-27 05:32:13 +00:00
Reg2Mem.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
RewriteStatepointsForGC.cpp [RS4GC] Drop invalid metadata after pointers are relocated 2017-06-12 21:26:53 +00:00
SCCP.cpp [SCCP] Simplify the code a bit. NFCI. 2017-06-16 20:50:31 +00:00
SROA.cpp [SROA] Fix APInt size when alloca address space is not 0 2017-06-27 18:26:06 +00:00
Scalar.cpp Remove the LoadCombine pass. It was never enabled and is unsupported. 2017-06-22 22:58:12 +00:00
Scalarizer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
SeparateConstOffsetFromGEP.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
SimpleLoopUnswitch.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
SimplifyCFGPass.cpp Split the SimplifyCFG pass into two variants. 2017-03-26 06:44:08 +00:00
Sink.cpp [Sink] Fix predicate in legality check 2017-06-09 19:31:10 +00:00
SpeculativeExecution.cpp Revert r301950: SpeculativeExecution: Stop using whitelist for costs 2017-05-10 12:30:07 +00:00
StraightLineStrengthReduce.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
StructurizeCFG.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
TailRecursionElimination.cpp [TRE] Improve code motion in TRE, use AA to tell whether a load can be moved before a call that writes to memory. 2017-06-19 15:21:18 +00:00