[PATCH] D73712: [SCEV] SCEVExpander::isHighCostExpansion(): assert if TTI is not provided
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 10:28:16 PST 2020
lebedev.ri updated this revision to Diff 246500.
lebedev.ri added a comment.
Rebased, NFC.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73712/new/
https://reviews.llvm.org/D73712
Files:
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -2138,6 +2138,10 @@
bool SCEVExpander::isHighCostExpansionHelper(
const SCEV *S, Loop *L, const Instruction *At, int &BudgetRemaining,
const TargetTransformInfo *TTI, SmallPtrSetImpl<const SCEV *> &Processed) {
+ // Was the cost of expansion of this expression already accounted for?
+ if (!Processed.insert(S).second)
+ return false; // We have already accounted for this expression.
+
// If we can find an existing value for this scev available at the point "At"
// then consider the expression cheap.
if (At && getRelatedExistingExpansion(S, At, L))
@@ -2159,8 +2163,6 @@
L, At, BudgetRemaining, TTI, Processed);
}
- if (!Processed.insert(S).second)
- return false;
if (auto *UDivExpr = dyn_cast<SCEVUDivExpr>(S)) {
// If the divisor is a power of two and the SCEV type fits in a native
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73712.246500.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200225/4765a106/attachment.bin>
More information about the llvm-commits
mailing list