1 ; RUN: opt -passes='print<inline-cost>' -disable-output %s 2>&1 | FileCheck %s
3 ; SROA analysis should yield non-zero savings for allocas passed through invariant group intrinsics
4 ; CHECK: SROACostSavings: 10
6 declare i8* @llvm.launder.invariant.group.p0i8(i8*)
7 declare i8* @llvm.strip.invariant.group.p0i8(i8*)
13 %r = call i32 @g(i32* %a)
17 define i32 @g(i32* %a) {
18 %a_i8 = bitcast i32* %a to i8*
19 %a_inv_i8 = call i8* @llvm.launder.invariant.group.p0i8(i8* %a_i8)
20 %a_inv = bitcast i8* %a_inv_i8 to i32*
21 %i1 = load i32, i32* %a_inv
22 %i2 = load i32, i32* %a_inv
23 %i3 = add i32 %i1, %i2
24 %t = call i8* @llvm.strip.invariant.group.p0i8(i8* %a_inv_i8)