diff options
| author | Adam Nemet <anemet@apple.com> | 2016-08-26 20:21:05 +0000 | 
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2016-08-26 20:21:05 +0000 | 
| commit | cef33141560c42cf81b4284cef25777bb7e2f11e (patch) | |
| tree | d9f6d731a76f587934dad64d16148d730f71ec6e /llvm/test/Transforms | |
| parent | 7775c3310c44af877f2132130e2e018dab232177 (diff) | |
| download | bcm5719-llvm-cef33141560c42cf81b4284cef25777bb7e2f11e.tar.gz bcm5719-llvm-cef33141560c42cf81b4284cef25777bb7e2f11e.zip | |
[Inliner] Report when inlining fails because callee's def is unavailable
Summary:
This is obviously an interesting case because it may motivate code
restructuring or LTO.
Reporting this requires instantiation of ORE in the loop where the call
sites are first gathered.  I've checked compile-time
overhead *with* -Rpass-with-hotness and the worst slow-down was 6% in
mcf and quickly tailing off.  As before without -Rpass-with-hotness
there is no overhead.
Because this could be a pretty noisy diagnostics, it is currently
qualified as 'verbose'.  As of this patch, 'verbose' diagnostics are
only emitted with -Rpass-with-hotness, i.e. when the output is expected
to be filtered.
Reviewers: eraman, chandlerc, davidxl, hfinkel
Subscribers: tejohnson, Prazek, davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D23415
llvm-svn: 279860
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/Inline/optimization-remarks.ll | 17 | 
1 files changed, 15 insertions, 2 deletions
| diff --git a/llvm/test/Transforms/Inline/optimization-remarks.ll b/llvm/test/Transforms/Inline/optimization-remarks.ll index 8a3e4d1b1fe..d8be0c0acfd 100644 --- a/llvm/test/Transforms/Inline/optimization-remarks.ll +++ b/llvm/test/Transforms/Inline/optimization-remarks.ll @@ -1,5 +1,14 @@ -; RUN: opt < %s -inline -pass-remarks=inline -pass-remarks-missed=inline -pass-remarks-analysis=inline -S 2>&1 | FileCheck %s +; RUN: opt < %s -inline -pass-remarks=inline -pass-remarks-missed=inline \ +; RUN:       -pass-remarks-analysis=inline -S 2>&1 | \ +; RUN:       FileCheck -check-prefix=CHECK -check-prefix=NO_HOTNESS %s +; RUN: opt < %s -inline -pass-remarks=inline -pass-remarks-missed=inline \ +; RUN:       -pass-remarks-analysis=inline -pass-remarks-with-hotness -S 2>&1 | \ +; RUN:       FileCheck -check-prefix=CHECK -check-prefix=HOTNESS %s +; HOTNESS: definition of fox is not available +; HOTNESS: fox will not be inlined into bar +; NO_HOTNESS-NOT: definition of fox is not available +; NO_HOTNESS-NOT: fox will not be inlined into bar  ; CHECK: foo should always be inlined (cost=always)  ; CHECK: foo inlined into bar  ; CHECK: foz should never be inlined (cost=never) @@ -32,6 +41,8 @@ entry:    ret float %conv  } +declare i32 @fox() +  ; Function Attrs: nounwind uwtable  define i32 @bar(i32 %j) #2 {  entry: @@ -48,7 +59,9 @@ entry:    %call2 = call float @foz(i32 %sub1, i32 %3)    %mul = fmul float %conv, %call2    %conv3 = fptosi float %mul to i32 -  ret i32 %conv3 +  %call3 = call i32 @fox() +  %add = add i32 %conv3, %call  +  ret i32 %add  }  attributes #0 = { alwaysinline nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | 

