llvm-project/llvm/lib/Transforms/InstCombine
Sanjay Patel 6844e21f59 [InstCombineCasts] Fix checks in sext->lshr->trunc pattern.
The comment says to avoid the case where zero bits are shifted into the truncated value, 
but the code checks that the shift is smaller than the truncated value instead of the 
number of bits added by the sign extension. Fixing this allows a shift by more than the 
value size to be introduced, which is undefined behavior, so the shift is capped at the 
value size minus one, which has the expected behavior of filling the value with the sign 
bit.

Patch by Jacob Young!

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

llvm-svn: 302548
2017-05-09 16:24:59 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [InstCombine][KnownBits] Use KnownBits better to detect nsw adds 2017-05-03 23:22:46 +00:00
InstCombineAndOrXor.cpp [InstCombine] add folds for not-of-shift-right 2017-05-08 20:49:59 +00:00
InstCombineCalls.cpp [KnownBits] Add wrapper methods for setting and clear all bits in the underlying APInts in KnownBits. 2017-05-05 17:36:09 +00:00
InstCombineCasts.cpp [InstCombineCasts] Fix checks in sext->lshr->trunc pattern. 2017-05-09 16:24:59 +00:00
InstCombineCompares.cpp [InstCombine] use local variable to reduce code duplication; NFCI 2017-05-08 16:33:42 +00:00
InstCombineInternal.h InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineLoadStoreAlloca.cpp [InstCombine] Reduce visitLoadInst() code duplication. NFCI. 2017-04-19 17:26:57 +00:00
InstCombineMulDivRem.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombinePHI.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineSelect.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineShifts.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineSimplifyDemanded.cpp [KnownBits] Add wrapper methods for setting and clear all bits in the underlying APInts in KnownBits. 2017-05-05 17:36:09 +00:00
InstCombineVectorOps.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstructionCombining.cpp [KnownBits] Add methods for determining if KnownBits is a constant value 2017-05-03 23:12:29 +00:00
LLVMBuild.txt