OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4dfad29
)
Check for the short-circuiting condition before performing
author
Dan Gohman
<gohman@apple.com>
Sun, 14 Jun 2009 22:53:57 +0000
(22:53 +0000)
committer
Dan Gohman
<gohman@apple.com>
Sun, 14 Jun 2009 22:53:57 +0000
(22:53 +0000)
the potentially expensive erase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73359
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
patch
|
blob
|
history
diff --git
a/lib/Analysis/ScalarEvolution.cpp
b/lib/Analysis/ScalarEvolution.cpp
index
ee077d5
..
a2ab6e6
100644
(file)
--- a/
lib/Analysis/ScalarEvolution.cpp
+++ b/
lib/Analysis/ScalarEvolution.cpp
@@
-1012,8
+1012,8
@@
SCEVHandle ScalarEvolution::getAddExpr(SmallVectorImpl<SCEVHandle> &Ops) {
// We found two constants, fold them together!
Ops[0] = getConstant(LHSC->getValue()->getValue() +
RHSC->getValue()->getValue());
+ if (Ops.size() == 2) return Ops[0];
Ops.erase(Ops.begin()+1); // Erase the folded element
- if (Ops.size() == 1) return Ops[0];
LHSC = cast<SCEVConstant>(Ops[0]);
}