llvm-6502/lib/Transforms/Scalar
Chandler Carruth 1faa445476 Fix a really bad miscompile introduced in r216865 - the else-if logic
chain became completely broken here as *all* intrinsic users ended up
being skipped, and the ones that seemed to be singled out were actually
the exact wrong set.

This is a great example of why long else-if chains can be easily
confusing. Switch the entire code to use early exits and early continues
to have simpler (and more importantly, correct) logic here, as well as
fixing the reversed logic for detecting and continuing on lifetime
intrinsics.

I've also significantly cleaned up the test case and added another test
case demonstrating an example where the optimization is not (trivially)
safe to perform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216871 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-01 10:09:18 +00:00
..
ADCE.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
CMakeLists.txt MergedLoadStoreMotion pass 2014-07-18 19:13:09 +00:00
ConstantHoisting.cpp ConstantHoisting.cpp: Add <tuple> for std::tie, since r207593 removed FileSystem.h, it includes <tuple>. 2014-04-30 06:44:50 +00:00
ConstantProp.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
CorrelatedValuePropagation.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
DCE.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
DeadStoreElimination.cpp Revert "r214897 - Remove dead zero store to calloc initialized memory" 2014-08-06 19:30:38 +00:00
EarlyCSE.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
FlattenCFGPass.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
GVN.cpp Introduce a helper to combine instruction metadata. 2014-08-15 15:46:38 +00:00
IndVarSimplify.cpp [CLNUP] Remove return after llvm_unreachable. Thanks to Hal Finkel for pointing. 2014-08-21 13:30:05 +00:00
JumpThreading.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
LICM.cpp Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size. 2014-08-21 05:55:13 +00:00
LLVMBuild.txt Add proper dependencies to LLVMBuild.txt in llvm/lib. 2013-12-10 05:39:34 +00:00
LoadCombine.cpp Fixing a few -Woverloaded-virtual warnings by exposing the hidden virtual function as well. No functional changes intended. 2014-07-30 19:23:59 +00:00
LoopDeletion.cpp Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
LoopIdiomRecognize.cpp Remove extra whitespace in function declaration. No functionality change. 2014-06-14 03:48:29 +00:00
LoopInstSimplify.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
LoopRerollPass.cpp Feeding isSafeToSpeculativelyExecute its DataLayout pointer 2014-07-10 14:41:31 +00:00
LoopRotation.cpp Fix typos in comments and doc 2014-08-05 23:27:34 +00:00
LoopStrengthReduce.cpp Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
LoopUnrollPass.cpp After unrolling a loop with llvm.loop.unroll.count metadata (unroll factor 2014-07-24 22:36:40 +00:00
LoopUnswitch.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
LowerAtomic.cpp IR: add "cmpxchg weak" variant to support permitted failure. 2014-06-13 14:24:07 +00:00
Makefile
MemCpyOptimizer.cpp Fix a really bad miscompile introduced in r216865 - the else-if logic 2014-09-01 10:09:18 +00:00
MergedLoadStoreMotion.cpp Fix for multi-line comment warning 2014-08-07 23:19:55 +00:00
PartiallyInlineLibCalls.cpp PartiallyInlineLibCalls: Check sqrt result type before transforming it. 2014-08-01 23:21:21 +00:00
Reassociate.cpp Reassociate x + -0.1234 * y into x - 0.1234 * y 2014-08-21 10:45:30 +00:00
Reg2Mem.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
SampleProfile.cpp Remove some calls to std::move. 2014-08-01 14:31:55 +00:00
Scalar.cpp Initialize FlattenCFG pass 2014-08-13 20:31:52 +00:00
Scalarizer.cpp Add scoped-noalias metadata 2014-07-24 14:25:39 +00:00
ScalarReplAggregates.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
SCCP.cpp Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 05:25:25 +00:00
SeparateConstOffsetFromGEP.cpp Partially revert r210444 due to performance regression 2014-07-16 23:25:00 +00:00
SimplifyCFGPass.cpp Remove 'using std::errro_code' from lib. 2014-06-13 02:24:39 +00:00
Sink.cpp Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
SROA.cpp [SROA] Fold a PHI node if all its incoming values are the same 2014-08-22 22:45:57 +00:00
StructurizeCFG.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
TailRecursionElimination.cpp We may visit a call that uses an alloca multiple times in callUsesLocalStack, sometimes with IsNocapture true and sometimes with IsNocapture false. We accidentally skipped work we needed to do in the IsNocapture=false case if we were called with IsNocapture=true the first time. Fixes PR20405! 2014-07-23 06:24:49 +00:00