Files
clang-p2996/llvm/test/Transforms/Reg2Mem/non-token-test.ll
HanSheng Zhang 200f3410cd [reg2mem] Skip non-sized Instructions (PR58890)
We can only convert sized values into alloca/load/store, skip
instructions returning other types.

Fixes https://github.com/llvm/llvm-project/issues/58890.

Differential Revision: https://reviews.llvm.org/D137700
2022-11-14 12:47:39 +01:00

25 lines
639 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=reg2mem -S < %s | FileCheck %s
%opaque = type opaque
declare %opaque @ret_opaque()
declare void @pass_opaque(%opaque)
define void @test() {
; CHECK-LABEL: @test(
; CHECK-NEXT: %"reg2mem alloca point" = bitcast i32 0 to i32
; CHECK-NEXT: [[X:%.*]] = call [[OPAQUE:%.*]] @ret_opaque()
; CHECK-NEXT: br label [[NEXT:%.*]]
; CHECK: next:
; CHECK-NEXT: call void @pass_opaque([[OPAQUE]] [[X]])
; CHECK-NEXT: ret void
;
%x = call %opaque @ret_opaque()
br label %next
next:
call void @pass_opaque(%opaque %x)
ret void
}