diff options
author | Dan Gohman <gohman@apple.com> | 2008-04-14 18:23:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-04-14 18:23:56 +0000 |
commit | 5e6ce7bb33c2f37572a7f5adc2895d293b379f64 (patch) | |
tree | 0fde2615d0b61ee9172087e82e458076645f27b8 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | b37dab136029a5c8d74ae38d2e1d5bfc70a5735a (diff) | |
download | bcm5719-llvm-5e6ce7bb33c2f37572a7f5adc2895d293b379f64.tar.gz bcm5719-llvm-5e6ce7bb33c2f37572a7f5adc2895d293b379f64.zip |
In the special case, call the comparison function instead of
manually performing the comparison. This allows the special
case to work correctly even in the case where someone is
experimenting with a different comparison function :-).
llvm-svn: 49670
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 1b4c277e1a7..4b4b97e2862 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -431,7 +431,7 @@ namespace { /// than the complexity of the RHS. This comparator is used to canonicalize /// expressions. struct VISIBILITY_HIDDEN SCEVComplexityCompare { - bool operator()(SCEV *LHS, SCEV *RHS) { + bool operator()(const SCEV *LHS, const SCEV *RHS) const { return LHS->getSCEVType() < RHS->getSCEVType(); } }; @@ -452,7 +452,7 @@ static void GroupByComplexity(std::vector<SCEVHandle> &Ops) { if (Ops.size() == 2) { // This is the common case, which also happens to be trivially simple. // Special case it. - if (Ops[0]->getSCEVType() > Ops[1]->getSCEVType()) + if (SCEVComplexityCompare()(Ops[1], Ops[0])) std::swap(Ops[0], Ops[1]); return; } |