llvm/lib/Transforms/Scalar
Igor Laevsky a277dc299e Strip metadata when speculatively hoisting instructions
This is fix for PR24059.

When we are hoisting instruction above some condition it may turn out
that metadata on this instruction was control dependant on the condition.
This metadata becomes invalid and we need to drop it.

This patch should cover most obvious places of speculative execution (which
I have found by greping isSafeToSpeculativelyExecute). I think there are more
cases but at least this change covers the severe ones.

Differential Revision: http://reviews.llvm.org/D14398



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 14:10:31 +00:00
..
ADCE.cpp [PM] Port ADCE to the new pass manager 2015-10-30 23:13:18 +00:00
AlignmentFromAssumptions.cpp [SCEV] Introduce ScalarEvolution::getOne and getZero. 2015-09-23 01:59:04 +00:00
BDCE.cpp Add GlobalsAA as preserved to a bunch of transforms 2015-09-10 10:22:12 +00:00
CMakeLists.txt LLE 6/6: Add LoopLoadElimination pass 2015-11-03 23:50:08 +00:00
ConstantHoisting.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
ConstantProp.cpp
CorrelatedValuePropagation.cpp [CVP] Fold return values if possible 2015-11-04 01:43:54 +00:00
DCE.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
DeadStoreElimination.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
EarlyCSE.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
FlattenCFGPass.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
Float2Int.cpp Prune trailing whitespaces. 2015-09-22 11:19:03 +00:00
GVN.cpp GVN: don't try to replace instruction with itself. 2015-10-23 20:30:02 +00:00
InductiveRangeCheckElimination.cpp Scalar: Remove some implicit ilist iterator conversions, NFC 2015-10-13 18:26:00 +00:00
IndVarSimplify.cpp Revert "[IndVarSimplify] Rewrite loop exit values with their initial values from loop preheader" 2015-11-03 07:14:39 +00:00
JumpThreading.cpp [ValueTracking] Add parameters to isImpliedCondition; NFC 2015-11-06 19:01:08 +00:00
LICM.cpp Strip metadata when speculatively hoisting instructions 2015-11-10 14:10:31 +00:00
LLVMBuild.txt Update libdeps in LLVMipo and LLVMScalarOpts, corresponding to r245940. 2015-08-25 17:11:17 +00:00
LoadCombine.cpp [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
LoopDeletion.cpp Add GlobalsAA as preserved to a bunch of transforms 2015-09-10 10:22:12 +00:00
LoopDistribute.cpp Allow LLE/LD and the loop versioning infrastructure to use SCEV predicates 2015-11-09 13:26:09 +00:00
LoopIdiomRecognize.cpp Simplify. NFC. 2015-11-09 16:56:06 +00:00
LoopInstSimplify.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
LoopInterchange.cpp Convert assert(false) into llvm_unreachable where it makes sense. 2015-10-25 22:28:27 +00:00
LoopLoadElimination.cpp Allow LLE/LD and the loop versioning infrastructure to use SCEV predicates 2015-11-09 13:26:09 +00:00
LoopRerollPass.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
LoopRotation.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
LoopStrengthReduce.cpp [LoopStrengthReduce] Don't bother fixing up PHIs from EH Pad preds 2015-11-08 05:04:07 +00:00
LoopUnrollPass.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
LoopUnswitch.cpp LoopPass: Simplify the API for adding a new loop. NFC 2015-10-22 21:21:32 +00:00
LowerAtomic.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
LowerExpectIntrinsic.cpp fix typo; NFC 2015-08-24 20:11:14 +00:00
Makefile
MemCpyOptimizer.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
MergedLoadStoreMotion.cpp Fix some Clang-tidy modernize warnings, other minor fixes. 2015-11-04 22:32:32 +00:00
NaryReassociate.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
PartiallyInlineLibCalls.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
PlaceSafepoints.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
Reassociate.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
Reg2Mem.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
RewriteStatepointsForGC.cpp [RS4GC] Strip noalias attribute after statepoint rewrite 2015-10-26 19:06:01 +00:00
Scalar.cpp LLE 6/6: Add LoopLoadElimination pass 2015-11-03 23:50:08 +00:00
Scalarizer.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
ScalarReplAggregates.cpp ScalarReplAggregates.cpp: Try to appease clash of anonymous::SROA in modules build. 2015-10-24 06:42:42 +00:00
SCCP.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
SeparateConstOffsetFromGEP.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
SimplifyCFGPass.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
Sink.cpp [Sink] Don't check BB.empty() 2015-10-22 20:29:08 +00:00
SpeculativeExecution.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
SROA.cpp [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
StraightLineStrengthReduce.cpp [SCEV] Introduce ScalarEvolution::getOne and getZero. 2015-09-23 01:59:04 +00:00
StructurizeCFG.cpp Scalar: Remove remaining ilist iterator implicit conversions 2015-10-13 19:26:58 +00:00
TailRecursionElimination.cpp Add 'notail' marker for call instructions. 2015-11-06 23:55:38 +00:00