[PATCH] D38514: [InstCombine] improve folds for icmp gt/lt (shr X, C1), C2
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 20:10:28 PDT 2017
craig.topper added a comment.
I think this changes behavior of the current code with "exact" shifts. Did we not have tests for that?
For example:
define i1 @lshrugt_01_01_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_01(
; CHECK-NEXT: [[C:%.*]] = icmp ugt i4 %x, 2
; CHECK-NEXT: ret i1 [[C]]
;
%s = lshr exact i4 %x, 1
%c = icmp ugt i4 %s, 1
ret i1 %c
}
define i1 @lshrugt_01_01(i4 %x) {
; CHECK-LABEL: @lshrugt_01_01(
; CHECK-NEXT: [[C:%.*]] = icmp ugt i4 %x, 3
; CHECK-NEXT: ret i1 [[C]]
;
%s = lshr i4 %x, 1
%c = icmp ugt i4 %s, 1
ret i1 %c
}
https://reviews.llvm.org/D38514
More information about the llvm-commits
mailing list