Expand the scope to include global values because they are now constants
authorReid Spencer <rspencer@reidspencer.com>
Sun, 18 Jul 2004 08:32:10 +0000 (08:32 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 18 Jul 2004 08:32:10 +0000 (08:32 +0000)
too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14964 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GCSE.cpp

index c24941320fc89fc4ffedbe21e6c23d74b628857f..a3452a3f847101f361b282266d68f24d411172cd 100644 (file)
@@ -185,7 +185,7 @@ void GCSE::ReplaceInstructionWith(Instruction *I, Value *V) {
 
   // If we are not replacing the instruction with a constant, we cannot do
   // anything special.
-  if (!isa<Constant>(V) || isa<GlobalValue>(V)) {
+  if (!isa<Constant>(V)) {
     I->replaceAllUsesWith(V);
 
     if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {