aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2021-04-30 13:22:35 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2021-04-30 13:55:11 +0300
commitba5b015b0de13b412d73d127ca181115c5e78717 (patch)
tree367d7266d346055c7fb6fc86fbc7ea6278ee75cb /llvm/lib/Analysis/InlineCost.cpp
parentfd89af6880f33ead708abe2f7d88ecb687d4e0d2 (diff)
downloadllvm-ba5b015b0de13b412d73d127ca181115c5e78717.zip
llvm-ba5b015b0de13b412d73d127ca181115c5e78717.tar.gz
llvm-ba5b015b0de13b412d73d127ca181115c5e78717.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 9105813..91ac849 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -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.