llvm/lib/Transforms/InstCombine
Duncan Sands 91fa1da2f7 Replacing zero-sized alloca's with a null pointer is too aggressive, instead
merge all zero-sized alloca's into one, fixing c43204g from the Ada ACATS
conformance testsuite.  What happened there was that a variable sized object
was being allocated on the stack, "alloca i8, i32 %size".  It was then being
passed to another function, which tested that the address was not null (raising
an exception if it was) then manipulated %size bytes in it (load and/or store).
The optimizers cleverly managed to deduce that %size was zero (congratulations
to them, as it isn't at all obvious), which made the alloca zero size, causing
the optimizers to replace it with null, which then caused the check mentioned
above to fail, and the exception to be raised, wrongly.  Note that no loads
and stores were actually being done to the alloca (the loop that does them is
executed %size times, i.e. is not executed), only the not-null address check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159202 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-26 13:39:21 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
InstCombine.h add a new pass to instrument loads and stores for run-time bounds checking 2012-05-22 17:19:09 +00:00
InstCombineAddSub.cpp canonicalize: 2012-06-08 22:30:05 +00:00
InstCombineAndOrXor.cpp InstCombine: fix a bug when combining (fcmp cc0 x, y) && (fcmp cc1 x, y). 2012-06-14 05:57:42 +00:00
InstCombineCalls.cpp instcombine: disable optimization of 'invoke null/undef'. I'll move this functionality to SimplifyCFG (since we cannot make changes to the CFG here). 2012-06-21 23:52:14 +00:00
InstCombineCasts.cpp Revert remaining part of r93200: "Disable folding sext(trunc(x)) -> x" 2012-06-22 16:36:43 +00:00
InstCombineCompares.cpp InstCombine: factor code better. 2012-06-11 08:01:25 +00:00
InstCombineLoadStoreAlloca.cpp Replacing zero-sized alloca's with a null pointer is too aggressive, instead 2012-06-26 13:39:21 +00:00
InstCombineMulDivRem.cpp Look pass zext to strength reduce an udiv. Patch by David Majnemer. rdar://11721329 2012-06-21 22:52:49 +00:00
InstCombinePHI.cpp
InstCombineSelect.cpp Fix a bug in FoldSelectOpOp. Bitcast ops may change the number of vector elements, which may disagree with the select condition type. 2012-06-07 20:28:57 +00:00
InstCombineShifts.cpp PR12967: Don't crash when trying to fold a shift that's larger than the type's size. 2012-05-27 22:03:32 +00:00
InstCombineSimplifyDemanded.cpp
InstCombineVectorOps.cpp
InstCombineWorklist.h
InstructionCombining.cpp improve optimization of invoke instructions: 2012-06-25 17:11:47 +00:00
LLVMBuild.txt
Makefile