[llvm] cbd9585 - [CVP] Add test for PR63330 (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 19 06:44:59 PDT 2023
Author: Nikita Popov
Date: 2023-06-19T15:44:51+02:00
New Revision: cbd9585ba2c9c50160075bdc9de20ccead286d60
URL: https://github.com/llvm/llvm-project/commit/cbd9585ba2c9c50160075bdc9de20ccead286d60
DIFF: https://github.com/llvm/llvm-project/commit/cbd9585ba2c9c50160075bdc9de20ccead286d60.diff
LOG: [CVP] Add test for PR63330 (NFC)
Added:
Modified:
llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll b/llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll
index 620cd5e0651ca..cc4644d83aaf5 100644
--- a/llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll
+++ b/llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll
@@ -326,3 +326,21 @@ define i8 @large.divisor.with.overflow.v2.unbound.x(i8 %x) {
%rem = urem i8 %x, 128
ret i8 %rem
}
+
+define i1 @icmp_after_expansion(i8 noundef %x) {
+; CHECK-LABEL: @icmp_after_expansion(
+; CHECK-NEXT: [[CMP_X_UPPER:%.*]] = icmp ult i8 [[X:%.*]], 6
+; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_X_UPPER]])
+; CHECK-NEXT: [[X_FROZEN:%.*]] = freeze i8 [[X]]
+; CHECK-NEXT: [[REM_UREM:%.*]] = sub nuw i8 [[X_FROZEN]], 3
+; CHECK-NEXT: [[REM_CMP:%.*]] = icmp ult i8 [[X_FROZEN]], 3
+; CHECK-NEXT: [[REM:%.*]] = select i1 [[REM_CMP]], i8 [[X_FROZEN]], i8 [[REM_UREM]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[REM]], 3
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %cmp.x.upper = icmp ult i8 %x, 6
+ call void @llvm.assume(i1 %cmp.x.upper)
+ %rem = urem i8 %x, 3
+ %cmp = icmp eq i8 %rem, 3
+ ret i1 %cmp
+}
More information about the llvm-commits
mailing list