llvm-project/llvm/lib/Transforms/InstCombine
Sanjay Patel e730ce87a5 [InstCombine] fix bug when offsetting case values of a switch (PR31260)
We could truncate the condition and then try to fold the add into the
original condition value causing wrong case constants to be used.

Move the offset transform ahead of the truncate transform and return
after each transform, so there's no chance of getting confused values.

Fix for:
https://llvm.org/bugs/show_bug.cgi?id=31260

llvm-svn: 289442
2016-12-12 16:13:52 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [InstCombine] use m_APInt to allow sub with constant folds for splat vectors 2016-10-14 16:31:54 +00:00
InstCombineAndOrXor.cpp add and use isBitwiseLogicOp() helper function; NFCI 2016-11-22 22:54:36 +00:00
InstCombineCalls.cpp [X86][InstCombine] Teach InstCombineCalls to simplify demanded elements for scalar FMA intrinsics. 2016-12-11 07:42:06 +00:00
InstCombineCasts.cpp [InstCombine] change select type to eliminate bitcasts 2016-12-03 15:25:16 +00:00
InstCombineCompares.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +00:00
InstCombineInternal.h [InstCombine] allow more narrowing transforms for logic ops 2016-11-30 20:48:54 +00:00
InstCombineLoadStoreAlloca.cpp [PR29121] Don't fold if it would produce atomic vector loads or stores 2016-12-01 20:17:06 +00:00
InstCombineMulDivRem.cpp fix formatting; NFC 2016-11-21 21:48:36 +00:00
InstCombinePHI.cpp Use the range variant of find/find_if instead of unpacking begin/end 2016-08-12 03:55:06 +00:00
InstCombineSelect.cpp add optional param to copy metadata when creating selects; NFC 2016-11-26 15:01:59 +00:00
InstCombineShifts.cpp [InstCombine] add helper for shift-by-shift folds; NFCI 2016-12-10 22:16:29 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine][XOP] The instructions for the scalar frcz intrinsics are defined to put 0 in the upper bits, not pass bits through like other intrinsics. So we should return a zero vector instead. 2016-12-11 22:32:38 +00:00
InstCombineVectorOps.cpp [InstCombine] avoid infinite loop from shuffle-extract-insert sequence (PR30923) 2016-11-10 00:15:14 +00:00
InstructionCombining.cpp [InstCombine] fix bug when offsetting case values of a switch (PR31260) 2016-12-12 16:13:52 +00:00
LLVMBuild.txt Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00