summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-03-15 00:50:21 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-03-15 00:50:21 +0000
commit899e439aeaded7689ab79f49f28b8f0801403c6d (patch)
tree3a990145b6c1093d64ef272ce18f7694b9ea6a4c /llvm/lib/Analysis
parentb9b73170e3dc9350ec9e8472fa7d749155a589d7 (diff)
downloadbcm5719-llvm-899e439aeaded7689ab79f49f28b8f0801403c6d.tar.gz
bcm5719-llvm-899e439aeaded7689ab79f49f28b8f0801403c6d.zip
Don't assume that the arguments are processed in some particular order.
This appears to not be the case with dragonegg at least in some contexts. Hopefully will fix the bootstrap assert failure there. llvm-svn: 152763
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index fa683f695e7..37aa729552b 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -434,9 +434,11 @@ void InlineCostAnalyzer::FunctionInfo::countCodeReductionForPointerPair(
= PointerArgs.find(OtherArg);
if (ArgIt == PointerArgs.end())
continue;
- assert(ArgIt->second < ArgIdx);
+ std::pair<unsigned, unsigned> ArgPair(ArgIt->second, ArgIdx);
+ if (ArgIt->second > ArgIdx)
+ std::swap(ArgPair.first, ArgPair.second);
- PointerArgPairWeights[std::make_pair(ArgIt->second, ArgIdx)]
+ PointerArgPairWeights[ArgPair]
+= countCodeReductionForConstant(Metrics, I);
}
} while (!Worklist.empty());
OpenPOWER on IntegriCloud