[llvm] [ValueLattice] Reset the count of range extensions when merging an undef with a constant range. (PR #77307)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 04:31:03 PST 2024


================
@@ -0,0 +1,91 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt -S -passes=sccp < %s | FileCheck %s
+
+define void @test() {
+; CHECK-LABEL: define void @test() {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TMP0:%.*]] = tail call i8 @geti8()
+; CHECK-NEXT:    [[CONV_I:%.*]] = zext i8 [[TMP0]] to i32
+; CHECK-NEXT:    [[CMP19_I_NOT:%.*]] = tail call i1 @geti1()
+; CHECK-NEXT:    br i1 [[CMP19_I_NOT]], label [[WHILE_END_I_THREAD:%.*]], label [[EXIT2:%.*]]
+; CHECK:       while.end.i.thread:
+; CHECK-NEXT:    [[TMP1:%.*]] = tail call i1 @geti1()
+; CHECK-NEXT:    [[TMP2:%.*]] = zext i1 [[TMP1]] to i32
+; CHECK-NEXT:    br label [[EXIT2]]
+; CHECK:       exit2:
+; CHECK-NEXT:    [[CMP_I12_I4:%.*]] = phi i32 [ [[TMP2]], [[WHILE_END_I_THREAD]] ], [ 0, [[ENTRY:%.*]] ]
+; CHECK-NEXT:    [[CMP:%.*]] = tail call i1 @geti1()
+; CHECK-NEXT:    br i1 [[CMP]], label [[IF_THEN6:%.*]], label [[IF_END_I_I:%.*]]
+; CHECK:       if.then6:
+; CHECK-NEXT:    [[CMP_I32:%.*]] = icmp ugt i32 [[CMP_I12_I4]], [[CONV_I]]
+; CHECK-NEXT:    br i1 [[CMP_I32]], label [[EXIT:%.*]], label [[COND_FALSE_I:%.*]]
+; CHECK:       cond.false.i:
+; CHECK-NEXT:    [[CMP_NOT6_I_I:%.*]] = tail call i1 @geti1()
+; CHECK-NEXT:    br i1 [[CMP_NOT6_I_I]], label [[EXIT]], label [[FOR_BODY_PREHEADER_I_I:%.*]]
+; CHECK:       for.body.preheader.i.i:
+; CHECK-NEXT:    [[CMP_NOT_I_I:%.*]] = tail call i1 @geti1()
+; CHECK-NEXT:    br label [[EXIT]]
+; CHECK:       exit:
+; CHECK-NEXT:    [[RETVAL_SROA_3_0_I:%.*]] = phi i32 [ 0, [[IF_THEN6]] ], [ 1, [[COND_FALSE_I]] ], [ 1, [[FOR_BODY_PREHEADER_I_I]] ]
+; CHECK-NEXT:    br i1 [[CMP19_I_NOT]], label [[IF_END_I_I]], label [[DO_BODY_I_I:%.*]]
+; CHECK:       do.body.i.i:
+; CHECK-NEXT:    br label [[IF_END_I_I]]
+; CHECK:       if.end.i.i:
+; CHECK-NEXT:    ret void
+;
+entry:
----------------
fhahn wrote:

Is it possible to reduce the test a bit further?

https://github.com/llvm/llvm-project/pull/77307


More information about the llvm-commits mailing list