[llvm] 194a4be - [InstCombine] Add more tests to freeze-phi.ll; NFC
Juneyoung Lee via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 26 17:43:16 PDT 2020
Author: Juneyoung Lee
Date: 2020-07-27T09:43:00+09:00
New Revision: 194a4beedd1e09ff0de3710ea431d8d3facd59e1
URL: https://github.com/llvm/llvm-project/commit/194a4beedd1e09ff0de3710ea431d8d3facd59e1
DIFF: https://github.com/llvm/llvm-project/commit/194a4beedd1e09ff0de3710ea431d8d3facd59e1.diff
LOG: [InstCombine] Add more tests to freeze-phi.ll; NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/freeze-phi.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/freeze-phi.ll b/llvm/test/Transforms/InstCombine/freeze-phi.ll
index fcda502a0d7f..430c2d2e8fe6 100644
--- a/llvm/test/Transforms/InstCombine/freeze-phi.ll
+++ b/llvm/test/Transforms/InstCombine/freeze-phi.ll
@@ -20,7 +20,52 @@ B:
C:
%y = phi i32 [0, %A], [1, %B]
%y.fr = freeze i32 %y
- ret i32 %y
+ ret i32 %y.fr
+}
+
+define <2 x i32> @vec(i1 %cond) {
+; CHECK-LABEL: @vec(
+; CHECK-NEXT: br i1 [[COND:%.*]], label [[A:%.*]], label [[B:%.*]]
+; CHECK: A:
+; CHECK-NEXT: br label [[C:%.*]]
+; CHECK: B:
+; CHECK-NEXT: br label [[C]]
+; CHECK: C:
+; CHECK-NEXT: [[Y:%.*]] = phi <2 x i32> [ <i32 0, i32 1>, [[A]] ], [ <i32 2, i32 3>, [[B]] ]
+; CHECK-NEXT: ret <2 x i32> [[Y]]
+;
+ br i1 %cond, label %A, label %B
+A:
+ br label %C
+B:
+ br label %C
+C:
+ %y = phi <2 x i32> [<i32 0, i32 1>, %A], [<i32 2, i32 3>, %B]
+ %y.fr = freeze <2 x i32> %y
+ ret <2 x i32> %y.fr
+}
+
+define <2 x i32> @vec_undef(i1 %cond) {
+; CHECK-LABEL: @vec_undef(
+; CHECK-NEXT: br i1 [[COND:%.*]], label [[A:%.*]], label [[B:%.*]]
+; CHECK: A:
+; CHECK-NEXT: br label [[C:%.*]]
+; CHECK: B:
+; CHECK-NEXT: br label [[C]]
+; CHECK: C:
+; CHECK-NEXT: [[Y:%.*]] = phi <2 x i32> [ <i32 0, i32 1>, [[A]] ], [ <i32 2, i32 undef>, [[B]] ]
+; CHECK-NEXT: [[Y_FR:%.*]] = freeze <2 x i32> [[Y]]
+; CHECK-NEXT: ret <2 x i32> [[Y_FR]]
+;
+ br i1 %cond, label %A, label %B
+A:
+ br label %C
+B:
+ br label %C
+C:
+ %y = phi <2 x i32> [<i32 0, i32 1>, %A], [<i32 2, i32 undef>, %B]
+ %y.fr = freeze <2 x i32> %y
+ ret <2 x i32> %y.fr
}
define i32 @one(i1 %cond, i32 %x) {
More information about the llvm-commits
mailing list