brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ccd58c8 Raw
28 lines · plain
1; RUN: opt < %s -passes=inline -inline-threshold=0 -debug-only=inline-cost -print-instruction-comments -S -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s2; RUN: opt < %s -passes='cgscc(inline)' -inline-threshold=0 -debug-only=inline-cost -print-instruction-comments -S -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s3; REQUIRES: asserts4 5target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"6target triple = "x86_64-unknown-unknown"7 8; Check that extractvalue's are free.9 10; CHECK: Analyzing call of callee... (caller:caller_range)11; CHECK-NEXT: Initial cost: -3512; CHECK-NEXT: define i32 @callee({ i32, i32 } %arg) {13; CHECK-NEXT: ; cost before = -35, cost after = -35, threshold before = 0, threshold after = 0, cost delta = 014; CHECK-NEXT:   %r = extractvalue { i32, i32 } %arg, 015; CHECK-NEXT: ; cost before = -35, cost after = -35, threshold before = 0, threshold after = 0, cost delta = 016; CHECK-NEXT:   ret i32 %r17; CHECK-NEXT: }18 19define i32 @callee({i32, i32} %arg) {20  %r = extractvalue {i32, i32} %arg, 021  ret i32 %r22}23 24define i32 @caller_range({i32, i32} %arg) {25  %r = call i32 @callee({i32, i32} %arg)26  ret i32 %r27}28