mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-20 02:58:10 +00:00
Inliner: Do zero-cost inlines even if above a negative threshold (PR24851)
Differential Revision: http://reviews.llvm.org/D14499 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252595 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fcb6d5f29c
commit
be73ba8c82
@ -1296,7 +1296,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) {
|
||||
else if (NumVectorInstructions <= NumInstructions / 2)
|
||||
Threshold -= (FiftyPercentVectorBonus - TenPercentVectorBonus);
|
||||
|
||||
return Cost < Threshold;
|
||||
return Cost <= std::max(0, Threshold);
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
||||
|
17
test/Transforms/Inline/zero-cost.ll
Normal file
17
test/Transforms/Inline/zero-cost.ll
Normal file
@ -0,0 +1,17 @@
|
||||
; RUN: opt -inline -S %s | FileCheck %s
|
||||
|
||||
define void @f() {
|
||||
entry:
|
||||
tail call void @g()
|
||||
unreachable
|
||||
|
||||
; CHECK-LABEL: @f
|
||||
; CHECK-NOT: call
|
||||
; CHECK: unreachable
|
||||
}
|
||||
|
||||
define void @g() {
|
||||
entry:
|
||||
unreachable
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user