brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · f59a565 Raw
67 lines · plain
1; RUN: opt < %s -passes="print<inline-cost>" 2>&1 | FileCheck %s2 3; CHECK:       Analyzing call of foo... (caller:main)4; CHECK: define ptr @foo() {5; CHECK:  cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}}6; CHECK:  %1 = inttoptr i64 754974720 to ptr7; CHECK:  cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}}8; CHECK:  ret ptr %19; CHECK: }10; CHECK:       NumConstantArgs: {{.*}}11; CHECK:       NumConstantOffsetPtrArgs: {{.*}}12; CHECK:       NumAllocaArgs: {{.*}}13; CHECK:       NumConstantPtrCmps: {{.*}}14; CHECK:       NumConstantPtrDiffs: {{.*}}15; CHECK:       NumInstructionsSimplified: {{.*}}16; CHECK:       NumInstructions: {{.*}}17; CHECK:       SROACostSavings: {{.*}}18; CHECK:       SROACostSavingsLost: {{.*}}19; CHECK:       LoadEliminationCost: {{.*}}20; CHECK:       ContainsNoDuplicateCall: {{.*}}21; CHECK:       Cost: {{.*}}22; CHECK:       Threshold: {{.*}}23; CHECK-EMPTY:24; CHECK:  Analyzing call of foo... (caller:main)25 26define ptr @foo() {27  %1 = inttoptr i64 754974720 to ptr28  ret ptr %129}30 31define ptr @main() {32  %1 = call ptr @foo()33  %2 = call ptr @foo()34  ret ptr %135}36 37; Make sure it also analyzes invoke call sites.38 39; CHECK:       Analyzing call of g... (caller:f)40; CHECK: define i32 @g(i32 %v) {41; CHECK: ; cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}}42; CHECK:   %p = icmp ugt i32 %v, 3543; CHECK: ; cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}}44; CHECK:   %r = select i1 %p, i32 %v, i32 745; CHECK: ; cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}}46; CHECK:   ret i32 %r47; CHECK: }48define i32 @g(i32 %v) {49  %p = icmp ugt i32 %v, 3550  %r = select i1 %p, i32 %v, i32 751  ret i32 %r52}53 54define void @f(i32 %v, ptr %dst) personality ptr @__gxx_personality_v0 {55  %v1 = invoke i32 @g(i32 %v)56          to label %bb1 unwind label %bb257bb1:58  store i32 %v1, ptr %dst59  ret void60bb2:61  %lpad.loopexit80 = landingpad { ptr, i32 }62          cleanup63  ret void64}65 66declare i32 @__gxx_personality_v0(...)67