llvm-for-llvmta/test/Transforms/InstSimplify/insertvalue.ll

20 lines
535 B
LLVM
Raw Permalink Normal View History

2022-04-25 10:02:23 +02:00
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instsimplify -S | FileCheck %s
define {i32, i32} @poison({i32, i32} %x) {
; CHECK-LABEL: @poison(
; CHECK-NEXT: ret { i32, i32 } [[X:%.*]]
;
%v = insertvalue {i32, i32} %x, i32 poison, 0
ret {i32, i32} %v
}
define {i32, i32} @poison2({i32, i32} %x) {
; CHECK-LABEL: @poison2(
; CHECK-NEXT: ret { i32, i32 } [[X:%.*]]
;
%elem = extractvalue {i32, i32} %x, 0
%v = insertvalue {i32, i32} poison, i32 %elem, 0
ret {i32, i32} %v
}