Changes
Summary
- [NFC][InstCombine] Add a few extra srem-by-power-of-two tests - extra uses
- [InstCombine] Remove insertRangeTest code that handles the equality case. For equality, the function called getTrue/getFalse with the VT of the comparison input. But getTrue/getFalse need the boolean VT. So if this code ever executed, it would assert. I believe these cases are removed by InstSimplify so we don't get here. So this patch just fixes up an assert to exclude the equality possibility and removes the broken code.
- [InstCombine] Don't use AddOne/SubOne to see if two APInts are 1 apart. Use APInt operations instead. NFCI AddOne/SubOne create new Constant objects. That seems heavy for comparing ConstantInts which wrap APInts. Just do the math on on the APInts and compare them.
Change Type | Path in Repository | Path in Workspace |
---|---|---|
![]() | /llvm/trunk/test/Transforms/InstCombine/rem.ll (diff) | llvm.src/test/Transforms/InstCombine/rem.ll |
Change Type | Path in Repository | Path in Workspace |
![]() | /llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (diff) | llvm.src/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp |
Change Type | Path in Repository | Path in Workspace |
![]() | /llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (diff) | llvm.src/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp |