llvm-project/llvm/lib/Transforms/InstCombine
Craig Topper 47fd2de304 [APInt] Fix bugs in isShiftedMask to match behavior of the similar function in MathExtras.h
This removes a parameter from the routine that was responsible for a lot of the issue. It was a bit count that had to be set to the BitWidth of the APInt and would get passed to getLowBitsSet. This guaranteed the call to getLowBitsSet would create an all ones value. This was then compared to (V | (V-1)). So the only shifted masks we detected had to have the MSB set.

The one in tree user is a transform in InstCombine that never fires due to earlier transforms covering the case better. I've submitted a patch to remove it completely, but for now I've just adapted it to the new interface for isShiftedMask.

llvm-svn: 299273
2017-03-31 22:23:42 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [InstCombine] Fix typo last->least. NFC 2017-03-30 22:28:55 +00:00
InstCombineAndOrXor.cpp [APInt] Fix bugs in isShiftedMask to match behavior of the similar function in MathExtras.h 2017-03-31 22:23:42 +00:00
InstCombineCalls.cpp Do not translate rint into nearbyint, but truncate it like nearbyint. 2017-03-31 19:58:07 +00:00
InstCombineCasts.cpp InstCombine: Check source value precision when reducing cast intrinsic 2017-03-20 21:59:24 +00:00
InstCombineCompares.cpp [InstCombine] Change the interface of SimplifyDemandedBits so that it takes the instruction and operand instead of the Use. 2017-03-25 06:52:52 +00:00
InstCombineInternal.h [InstCombine] Change the interface of SimplifyDemandedBits so that it takes the instruction and operand instead of the Use. 2017-03-25 06:52:52 +00:00
InstCombineLoadStoreAlloca.cpp [InstCombine] Fix bug in pointer replacement 2017-02-24 20:27:25 +00:00
InstCombineMulDivRem.cpp [InstCombine] improve readability; NFCI 2017-03-14 17:27:27 +00:00
InstCombinePHI.cpp fix formatting; NFC 2017-01-31 17:25:42 +00:00
InstCombineSelect.cpp [InstCombine] avoid breaking up bitcasted vector min/max patterns (PR32306) 2017-03-16 20:42:45 +00:00
InstCombineShifts.cpp [InstCombine] allow (X * C2) << C1 --> X * (C2 << C1) for vectors 2017-02-09 23:13:04 +00:00
InstCombineSimplifyDemanded.cpp [APInt] Remove shift functions from APIntOps namespace. Replace the few users with the APInt class methods. NFCI 2017-03-31 20:01:16 +00:00
InstCombineVectorOps.cpp [InstCombine] canonicalize insertelement of scalar constant ahead of insertelement of variable 2017-03-22 17:10:44 +00:00
InstructionCombining.cpp [InstCombine] When adding an Instruction and its Users to the worklist at the same time, make sure we put the Users in first. Then put in the instruction. 2017-03-31 21:35:30 +00:00
LLVMBuild.txt