diff options
| author | Nikita Popov <npopov@redhat.com> | 2023-02-15 16:32:46 +0100 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2023-02-15 16:34:55 +0100 |
| commit | 22882c39df71397cc6f9774d18e87d06e016c55f (patch) | |
| tree | 19bb839cb52cf6112597851bf89c1a6d967219b3 | |
| parent | 93164dba086df98d50bccf210e3e65115342c483 (diff) | |
| download | llvm-22882c39df71397cc6f9774d18e87d06e016c55f.zip llvm-22882c39df71397cc6f9774d18e87d06e016c55f.tar.gz llvm-22882c39df71397cc6f9774d18e87d06e016c55f.tar.bz2 | |
[InstSimplify] Add additional insertvalue into undef tests (NFC)
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/insertvalue.ll | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/llvm/test/Transforms/InstSimplify/insertvalue.ll b/llvm/test/Transforms/InstSimplify/insertvalue.ll index d9cf8dc4e..b236073 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 } |
