From: Nikita Popov Date: Mon, 19 Jun 2023 13:38:35 +0000 (+0200) Subject: [CVP] Add test for PR63330 (NFC) X-Git-Tag: upstream/17.0.6~4582 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbd9585ba2c9c50160075bdc9de20ccead286d60;p=platform%2Fupstream%2Fllvm.git [CVP] Add test for PR63330 (NFC) --- diff --git a/llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll b/llvm/test/Transforms/CorrelatedValuePropagation/urem-expansion.ll index 620cd5e..cc4644d 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 +}