xref: /llvm-project/llvm/test/Transforms/Inline/gep_from_constant.ll (revision 151602c7a9935558ca671b35359989b261045db0)
1; RUN: opt < %s -passes="print<inline-cost>" 2>&1 | FileCheck %s
2
3; CHECK-LABEL: @foo
4; CHECK: cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}}, simplified to ptr inttoptr (i64 754974760 to ptr)
5
6define ptr @foo(i64 %0) {
7  %2 = inttoptr i64 754974720 to ptr
8  %3 = getelementptr ptr addrspace(1), ptr %2, i64 %0
9  ret ptr %3
10}
11
12define ptr @main() {
13  %1 = call ptr @foo(i64 5)
14  ret ptr %1
15}
16