diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-03-15 00:50:21 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-03-15 00:50:21 +0000 |
commit | 899e439aeaded7689ab79f49f28b8f0801403c6d (patch) | |
tree | 3a990145b6c1093d64ef272ce18f7694b9ea6a4c /llvm/lib/Analysis/InlineCost.cpp | |
parent | b9b73170e3dc9350ec9e8472fa7d749155a589d7 (diff) | |
download | bcm5719-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/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 6 |
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()); |