mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-30 17:33:24 +00:00
38b6d9dd22
can't handle. Also don't produce non-zero results for things which won't be transformed by SROA at all just because we saw the loads/stores before we saw the use of the address. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148536 91177308-0d34-0410-b5e6-96231b3b80d8
45 lines
1.1 KiB
LLVM
45 lines
1.1 KiB
LLVM
; RUN: opt -inline < %s -S -o - -inline-threshold=8 | FileCheck %s
|
|
|
|
declare void @llvm.lifetime.start(i64 %size, i8* nocapture %ptr)
|
|
|
|
@glbl = external global i32
|
|
|
|
define void @outer1() {
|
|
; CHECK: @outer1
|
|
; CHECK-NOT: call void @inner1
|
|
%ptr = alloca i32
|
|
call void @inner1(i32* %ptr)
|
|
ret void
|
|
}
|
|
|
|
define void @inner1(i32 *%ptr) {
|
|
%A = load i32* %ptr
|
|
store i32 0, i32* %ptr
|
|
%C = getelementptr i32* %ptr, i32 0
|
|
%D = getelementptr i32* %ptr, i32 1
|
|
%E = bitcast i32* %ptr to i8*
|
|
%F = select i1 false, i32* %ptr, i32* @glbl
|
|
call void @llvm.lifetime.start(i64 0, i8* %E)
|
|
ret void
|
|
}
|
|
|
|
define void @outer2() {
|
|
; CHECK: @outer2
|
|
; CHECK: call void @inner2
|
|
%ptr = alloca i32
|
|
call void @inner2(i32* %ptr)
|
|
ret void
|
|
}
|
|
|
|
; %D poisons this call, scalar-repl can't handle that instruction.
|
|
define void @inner2(i32 *%ptr) {
|
|
%A = load i32* %ptr
|
|
store i32 0, i32* %ptr
|
|
%C = getelementptr i32* %ptr, i32 0
|
|
%D = getelementptr i32* %ptr, i32 %A
|
|
%E = bitcast i32* %ptr to i8*
|
|
%F = select i1 false, i32* %ptr, i32* @glbl
|
|
call void @llvm.lifetime.start(i64 0, i8* %E)
|
|
ret void
|
|
}
|