[llvm] 58ec867 - [InstSimplify] add more tests for freeze(constant); NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 24 06:53:56 PDT 2020
Author: Sanjay Patel
Date: 2020-03-24T09:53:49-04:00
New Revision: 58ec867a3badcc75143d93e8922fc618eb9472c1
URL: https://github.com/llvm/llvm-project/commit/58ec867a3badcc75143d93e8922fc618eb9472c1
DIFF: https://github.com/llvm/llvm-project/commit/58ec867a3badcc75143d93e8922fc618eb9472c1.diff
LOG: [InstSimplify] add more tests for freeze(constant); NFC
These should really be moved over to a ConstantFolding test file,
but since this may overlap with the in-progress D76010 and similar
tests already exist here, we can do that as a later cleanup.
Added:
Modified:
llvm/test/Transforms/InstSimplify/freeze.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/freeze.ll b/llvm/test/Transforms/InstSimplify/freeze.ll
index 0e631426b647..52d1f72edacb 100644
--- a/llvm/test/Transforms/InstSimplify/freeze.ll
+++ b/llvm/test/Transforms/InstSimplify/freeze.ll
@@ -65,6 +65,24 @@ define <2 x i32> @constvector() {
ret <2 x i32> %x
}
+define <3 x i5> @constvector_weird() {
+; CHECK-LABEL: @constvector_weird(
+; CHECK-NEXT: [[X:%.*]] = freeze <3 x i5> <i5 0, i5 1, i5 10>
+; CHECK-NEXT: ret <3 x i5> [[X]]
+;
+ %x = freeze <3 x i5> <i5 0, i5 1, i5 42>
+ ret <3 x i5> %x
+}
+
+define <2 x float> @constvector_FP() {
+; CHECK-LABEL: @constvector_FP(
+; CHECK-NEXT: [[X:%.*]] = freeze <2 x float> <float 0.000000e+00, float 1.000000e+00>
+; CHECK-NEXT: ret <2 x float> [[X]]
+;
+ %x = freeze <2 x float> <float 0.0, float 1.0>
+ ret <2 x float> %x
+}
+
define <2 x i32> @constvector_noopt() {
; CHECK-LABEL: @constvector_noopt(
; CHECK-NEXT: [[X:%.*]] = freeze <2 x i32> <i32 0, i32 undef>
@@ -74,6 +92,24 @@ define <2 x i32> @constvector_noopt() {
ret <2 x i32> %x
}
+define <3 x i5> @constvector_weird_noopt() {
+; CHECK-LABEL: @constvector_weird_noopt(
+; CHECK-NEXT: [[X:%.*]] = freeze <3 x i5> <i5 0, i5 undef, i5 10>
+; CHECK-NEXT: ret <3 x i5> [[X]]
+;
+ %x = freeze <3 x i5> <i5 0, i5 undef, i5 42>
+ ret <3 x i5> %x
+}
+
+define <2 x float> @constvector_FP_noopt() {
+; CHECK-LABEL: @constvector_FP_noopt(
+; CHECK-NEXT: [[X:%.*]] = freeze <2 x float> <float 0.000000e+00, float undef>
+; CHECK-NEXT: ret <2 x float> [[X]]
+;
+ %x = freeze <2 x float> <float 0.0, float undef>
+ ret <2 x float> %x
+}
+
define void @alloca() {
; CHECK-LABEL: @alloca(
; CHECK-NEXT: [[P:%.*]] = alloca i8
More information about the llvm-commits
mailing list