[llvm] c232a15 - [InstSimplify] Add additional test for PR49839 (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 13 03:23:42 PDT 2022
Author: Nikita Popov
Date: 2022-06-13T12:23:30+02:00
New Revision: c232a15df4460cb861b795be363cf77f12f3d77e
URL: https://github.com/llvm/llvm-project/commit/c232a15df4460cb861b795be363cf77f12f3d77e
DIFF: https://github.com/llvm/llvm-project/commit/c232a15df4460cb861b795be363cf77f12f3d77e.diff
LOG: [InstSimplify] Add additional test for PR49839 (NFC)
This is a variant involving an aggregate constant, which was not
covered by the previous patch.
Added:
Modified:
llvm/test/Transforms/InstSimplify/phi.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/phi.ll b/llvm/test/Transforms/InstSimplify/phi.ll
index b83ebcbadeab6..8565883b0492d 100644
--- a/llvm/test/Transforms/InstSimplify/phi.ll
+++ b/llvm/test/Transforms/InstSimplify/phi.ll
@@ -195,3 +195,23 @@ join:
%phi = phi i64 [ srem (i64 1, i64 ptrtoint (ptr @g to i64)), %if ], [ srem (i64 1, i64 ptrtoint (ptr @g to i64)) , %entry ]
ret i64 %phi
}
+
+define <1 x i64> @pr49839_vector(i1 %c) {
+; CHECK-LABEL: @pr49839_vector(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br i1 [[C:%.*]], label [[IF:%.*]], label [[JOIN:%.*]]
+; CHECK: if:
+; CHECK-NEXT: br label [[JOIN]]
+; CHECK: join:
+; CHECK-NEXT: ret <1 x i64> <i64 srem (i64 1, i64 ptrtoint (ptr @g to i64))>
+;
+entry:
+ br i1 %c, label %if, label %join
+
+if:
+ br label %join
+
+join:
+ %phi = phi <1 x i64> [ poison, %if ], [ <i64 srem (i64 1, i64 ptrtoint (ptr @g to i64))>, %entry ]
+ ret <1 x i64> %phi
+}
More information about the llvm-commits
mailing list