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 ptr @llvm.launder.invariant.group.p0(ptr)
7 declare ptr @llvm.strip.invariant.group.p0(ptr)
13 %r = call i32 @g(ptr %a)
17 define i32 @g(ptr %a) {
18 %a_inv_i8 = call ptr @llvm.launder.invariant.group.p0(ptr %a)
19 %i1 = load i32, ptr %a_inv_i8
20 %i2 = load i32, ptr %a_inv_i8
21 %i3 = add i32 %i1, %i2
22 %t = call ptr @llvm.strip.invariant.group.p0(ptr %a_inv_i8)