[PATCH] D38521: [InstCombine] Improve support for ashr in foldICmpAndShift
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 09:56:40 PDT 2017
spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:1540
// obvious, but we can prove that they are correct using an SMT solver.
- if (!Cmp.isSigned() ||
- (!C2.shl(*C3).isNegative() && !C1.shl(*C3).isNegative()))
- CanFold = true;
+ // For an arithmetic shift right we can do the same, if we we ensure
+ // the And doesn't use any bits being shifted in. Normally these would
----------------
extra 'we'
================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:1542
+ // the And doesn't use any bits being shifted in. Normally these would
+ // turned in lshr by SimplifyDemandedBits, but not if there is an
+ // additional user.
----------------
turned in -> be turned into
https://reviews.llvm.org/D38521
More information about the llvm-commits
mailing list