[llvm] 683b49b - [NFC][LICM] Autogenerate checklines for one function to simplify update
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 5 16:48:10 PST 2022
Author: Roman Lebedev
Date: 2022-12-06T03:47:46+03:00
New Revision: 683b49b15108dff6da761a098911b0f03c9bd7ed
URL: https://github.com/llvm/llvm-project/commit/683b49b15108dff6da761a098911b0f03c9bd7ed
DIFF: https://github.com/llvm/llvm-project/commit/683b49b15108dff6da761a098911b0f03c9bd7ed.diff
LOG: [NFC][LICM] Autogenerate checklines for one function to simplify update
Added:
Modified:
llvm/test/Transforms/LICM/hoist-phi.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LICM/hoist-phi.ll b/llvm/test/Transforms/LICM/hoist-phi.ll
index 25fc2add39c5f..90c616c8d75f8 100644
--- a/llvm/test/Transforms/LICM/hoist-phi.ll
+++ b/llvm/test/Transforms/LICM/hoist-phi.ll
@@ -624,23 +624,50 @@ end:
; We can hoist blocks that contain an edge that exits the loop by ignoring that
; edge in the hoisted block.
-; CHECK-LABEL: @triangle_phi_loopexit
define void @triangle_phi_loopexit(i32 %x, ptr %p) {
-; CHECK-LABEL: entry:
-; CHECK-DAG: %add = add i32 %x, 1
-; CHECK-DAG: %cmp1 = icmp sgt i32 %x, 0
-; CHECK-DAG: %cmp2 = icmp sgt i32 10, %add
-; CHECK-ENABLED: br i1 %cmp1, label %[[IF_LICM:.*]], label %[[THEN_LICM:.*]]
+; CHECK-DISABLED-LABEL: @triangle_phi_loopexit(
+; CHECK-DISABLED-NEXT: entry:
+; CHECK-DISABLED-NEXT: [[ADD:%.*]] = add i32 [[X:%.*]], 1
+; CHECK-DISABLED-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[X]], 0
+; CHECK-DISABLED-NEXT: [[CMP2:%.*]] = icmp sgt i32 10, [[ADD]]
+; CHECK-DISABLED-NEXT: br label [[LOOP:%.*]]
+; CHECK-DISABLED: loop:
+; CHECK-DISABLED-NEXT: br i1 [[CMP1]], label [[IF:%.*]], label [[THEN:%.*]]
+; CHECK-DISABLED: if:
+; CHECK-DISABLED-NEXT: br i1 [[CMP2]], label [[THEN]], label [[END:%.*]]
+; CHECK-DISABLED: then:
+; CHECK-DISABLED-NEXT: [[PHI:%.*]] = phi i32 [ [[ADD]], [[IF]] ], [ [[X]], [[LOOP]] ]
+; CHECK-DISABLED-NEXT: store i32 [[PHI]], ptr [[P:%.*]], align 4
+; CHECK-DISABLED-NEXT: [[CMP3:%.*]] = icmp ne i32 [[PHI]], 0
+; CHECK-DISABLED-NEXT: br i1 [[CMP3]], label [[LOOP]], label [[END]]
+; CHECK-DISABLED: end:
+; CHECK-DISABLED-NEXT: ret void
+;
+; CHECK-ENABLED-LABEL: @triangle_phi_loopexit(
+; CHECK-ENABLED-NEXT: entry:
+; CHECK-ENABLED-NEXT: [[ADD:%.*]] = add i32 [[X:%.*]], 1
+; CHECK-ENABLED-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[X]], 0
+; CHECK-ENABLED-NEXT: [[CMP2:%.*]] = icmp sgt i32 10, [[ADD]]
+; CHECK-ENABLED-NEXT: br i1 [[CMP1]], label [[IF_LICM:%.*]], label [[THEN_LICM:%.*]]
+; CHECK-ENABLED: if.licm:
+; CHECK-ENABLED-NEXT: br label [[THEN_LICM]]
+; CHECK-ENABLED: then.licm:
+; CHECK-ENABLED-NEXT: [[PHI:%.*]] = phi i32 [ [[ADD]], [[IF_LICM]] ], [ [[X]], [[ENTRY:%.*]] ]
+; CHECK-ENABLED-NEXT: [[CMP3:%.*]] = icmp ne i32 [[PHI]], 0
+; CHECK-ENABLED-NEXT: br label [[LOOP:%.*]]
+; CHECK-ENABLED: loop:
+; CHECK-ENABLED-NEXT: br i1 [[CMP1]], label [[IF:%.*]], label [[THEN:%.*]]
+; CHECK-ENABLED: if:
+; CHECK-ENABLED-NEXT: br i1 [[CMP2]], label [[THEN]], label [[END:%.*]]
+; CHECK-ENABLED: then:
+; CHECK-ENABLED-NEXT: store i32 [[PHI]], ptr [[P:%.*]], align 4
+; CHECK-ENABLED-NEXT: br i1 [[CMP3]], label [[LOOP]], label [[END]]
+; CHECK-ENABLED: end:
+; CHECK-ENABLED-NEXT: ret void
+;
entry:
br label %loop
-; CHECK-ENABLED: [[IF_LICM]]:
-; CHECK-ENABLED: br label %[[THEN_LICM]]
-
-; CHECK-ENABLED: [[THEN_LICM]]:
-; CHECK-ENABLED: %phi = phi i32 [ %add, %[[IF_LICM]] ], [ %x, %entry ]
-; CHECK: br label %loop
-
loop:
%cmp1 = icmp sgt i32 %x, 0
br i1 %cmp1, label %if, label %then
@@ -650,8 +677,6 @@ if:
%cmp2 = icmp sgt i32 10, %add
br i1 %cmp2, label %then, label %end
-; CHECK-LABEL: then:
-; CHECK-DISABLED: %phi = phi i32 [ %add, %if ], [ %x, %loop ]
then:
%phi = phi i32 [ %add, %if ], [ %x, %loop ]
store i32 %phi, ptr %p
More information about the llvm-commits
mailing list