bug 122:
- Minimize redundant isa<GlobalValue> usage
llvm-svn: 14948
diff --git a/llvm/lib/Transforms/Scalar/GCSE.cpp b/llvm/lib/Transforms/Scalar/GCSE.cpp
index 7d93c50..c249413 100644
--- a/llvm/lib/Transforms/Scalar/GCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/GCSE.cpp
@@ -78,8 +78,7 @@
VN.getEqualNumberNodes(AI, EqualValues);
if (!EqualValues.empty()) {
for (unsigned i = 0, e = EqualValues.size(); i != e; ++i)
- if (isa<Constant>(EqualValues[i]) ||
- isa<GlobalValue>(EqualValues[i])) {
+ if (isa<Constant>(EqualValues[i])) {
AI->replaceAllUsesWith(EqualValues[i]);
++NumArgsRepl;
Changed = true;
@@ -186,7 +185,7 @@
// If we are not replacing the instruction with a constant, we cannot do
// anything special.
- if (!isa<Constant>(V)) {
+ if (!isa<Constant>(V) || isa<GlobalValue>(V)) {
I->replaceAllUsesWith(V);
if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {