1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[InlineCost] CallAnalyzer: use TTI info for extractvalue - they are free (PR50099)

It seems incorrect to use TTI data in some places,
and override it in others. In this case, TTI says
that `extractvalue` are free, yet we bill them.

While this doesn't address https://bugs.llvm.org/show_bug.cgi?id=50099 yet,
it reduces the cost from 55 to 50 while the threshold is 45.

Differential Revision: https://reviews.llvm.org/D101228
This commit is contained in:
Roman Lebedev 2021-04-30 13:22:35 +03:00
parent dbb5e2911e
commit 9713d9790b
2 changed files with 6 additions and 6 deletions

View File

@ -1759,8 +1759,8 @@ bool CallAnalyzer::visitExtractValue(ExtractValueInst &I) {
}))
return true;
// SROA can look through these but give them a cost.
return false;
// SROA can't look through these, but they may be free.
return Base::visitExtractValue(I);
}
bool CallAnalyzer::visitInsertValue(InsertValueInst &I) {
@ -1772,8 +1772,8 @@ bool CallAnalyzer::visitInsertValue(InsertValueInst &I) {
}))
return true;
// SROA can look through these but give them a cost.
return false;
// SROA can't look through these, but they may be free.
return Base::visitInsertValue(I);
}
/// Try to simplify a call site.

View File

@ -9,9 +9,9 @@ target triple = "x86_64-unknown-unknown"
; CHECK: Analyzing call of callee... (caller:caller_range)
; CHECK-NEXT: define i32 @callee({ i32, i32 } %arg) {
; CHECK-NEXT: ; cost before = -35, cost after = -30, threshold before = 0, threshold after = 0, cost delta = 5
; CHECK-NEXT: ; cost before = -35, cost after = -35, threshold before = 0, threshold after = 0, cost delta = 0
; CHECK-NEXT: %r = extractvalue { i32, i32 } %arg, 0
; CHECK-NEXT: ; cost before = -30, cost after = -30, threshold before = 0, threshold after = 0, cost delta = 0
; CHECK-NEXT: ; cost before = -35, cost after = -35, threshold before = 0, threshold after = 0, cost delta = 0
; CHECK-NEXT: ret i32 %r
; CHECK-NEXT: }