mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
de5a1417da
SROA can handle invariant group intrinsics, let the inliner know that for better heuristics when the intrinsics are present. This fixes size issues in a couple files when turning on -fstrict-vtable-pointers in Chrome. Reviewed By: rnk, mtrofin Differential Revision: https://reviews.llvm.org/D100249
27 lines
745 B
LLVM
27 lines
745 B
LLVM
; RUN: opt -passes='print<inline-cost>' -disable-output %s 2>&1 | FileCheck %s
|
|
|
|
; SROA analysis should yield non-zero savings for allocas passed through invariant group intrinsics
|
|
; CHECK: SROACostSavings: 10
|
|
|
|
declare i8* @llvm.launder.invariant.group.p0i8(i8*)
|
|
declare i8* @llvm.strip.invariant.group.p0i8(i8*)
|
|
|
|
declare void @b()
|
|
|
|
define i32 @f() {
|
|
%a = alloca i32
|
|
%r = call i32 @g(i32* %a)
|
|
ret i32 %r
|
|
}
|
|
|
|
define i32 @g(i32* %a) {
|
|
%a_i8 = bitcast i32* %a to i8*
|
|
%a_inv_i8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %a_i8)
|
|
%a_inv = bitcast i8* %a_inv_i8 to i32*
|
|
%i1 = load i32, i32* %a_inv
|
|
%i2 = load i32, i32* %a_inv
|
|
%i3 = add i32 %i1, %i2
|
|
%t = call i8* @llvm.strip.invariant.group.p0i8(i8* %a_inv_i8)
|
|
ret i32 %i3
|
|
}
|