[llvm] 22882c3 - [InstSimplify] Add additional insertvalue into undef tests (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 07:35:02 PST 2023


Author: Nikita Popov
Date: 2023-02-15T16:34:55+01:00
New Revision: 22882c39df71397cc6f9774d18e87d06e016c55f

URL: https://github.com/llvm/llvm-project/commit/22882c39df71397cc6f9774d18e87d06e016c55f
DIFF: https://github.com/llvm/llvm-project/commit/22882c39df71397cc6f9774d18e87d06e016c55f.diff

LOG: [InstSimplify] Add additional insertvalue into undef tests (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/insertvalue.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/insertvalue.ll b/llvm/test/Transforms/InstSimplify/insertvalue.ll
index d9cf8dc4e381..b2360739530e 100644
--- a/llvm/test/Transforms/InstSimplify/insertvalue.ll
+++ b/llvm/test/Transforms/InstSimplify/insertvalue.ll
@@ -9,6 +9,23 @@ define {i32, i32} @insert_poison({i32, i32} %x) {
   ret {i32, i32} %v
 }
 
+define {i32, i32} @insert_undef({i32, i32} %x) {
+; CHECK-LABEL: @insert_undef(
+; CHECK-NEXT:    [[V:%.*]] = insertvalue { i32, i32 } [[X:%.*]], i32 undef, 0
+; CHECK-NEXT:    ret { i32, i32 } [[V]]
+;
+  %v = insertvalue {i32, i32} %x, i32 undef, 0
+  ret {i32, i32} %v
+}
+
+define {i32, i32} @insert_undef_into_non_poison({i32, i32} noundef %x) {
+; CHECK-LABEL: @insert_undef_into_non_poison(
+; CHECK-NEXT:    ret { i32, i32 } [[X:%.*]]
+;
+  %v = insertvalue {i32, i32} %x, i32 undef, 0
+  ret {i32, i32} %v
+}
+
 define {i32, i32} @insert_into_poison({i32, i32} %x) {
 ; CHECK-LABEL: @insert_into_poison(
 ; CHECK-NEXT:    ret { i32, i32 } [[X:%.*]]
@@ -18,19 +35,20 @@ define {i32, i32} @insert_into_poison({i32, i32} %x) {
   ret {i32, i32} %v
 }
 
-define {i32, i32} @insert_undef({i32, i32} %x) {
-; CHECK-LABEL: @insert_undef(
-; CHECK-NEXT:    [[V:%.*]] = insertvalue { i32, i32 } [[X:%.*]], i32 undef, 0
-; CHECK-NEXT:    ret { i32, i32 } [[V]]
+define {i32, i32} @insert_into_undef({i32, i32} %x) {
+; CHECK-LABEL: @insert_into_undef(
+; CHECK-NEXT:    ret { i32, i32 } [[X:%.*]]
 ;
-  %v = insertvalue {i32, i32} %x, i32 undef, 0
+  %elem = extractvalue {i32, i32} %x, 0
+  %v = insertvalue {i32, i32} undef, i32 %elem, 0
   ret {i32, i32} %v
 }
 
-define {i32, i32} @insert_undef_into_non_poison({i32, i32} noundef %x) {
-; CHECK-LABEL: @insert_undef_into_non_poison(
+define {i32, i32} @insert_non_poison_into_undef({i32, i32} noundef %x) {
+; CHECK-LABEL: @insert_non_poison_into_undef(
 ; CHECK-NEXT:    ret { i32, i32 } [[X:%.*]]
 ;
-  %v = insertvalue {i32, i32} %x, i32 undef, 0
+  %elem = extractvalue {i32, i32} %x, 0
+  %v = insertvalue {i32, i32} undef, i32 %elem, 0
   ret {i32, i32} %v
 }


        


More information about the llvm-commits mailing list