for instructions with void type we have no choice but print the instruction as
authorTorok Edwin <edwintorok@gmail.com>
Fri, 29 May 2009 10:28:44 +0000 (10:28 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Fri, 29 May 2009 10:28:44 +0000 (10:28 +0000)
is, otherwise we get a <badref>.

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

lib/Transforms/Scalar/GVN.cpp

index 946c33eea44501326da9163cdc02222d28f0e72a..bd13ee59b3ff9d7e1a2439a84f9541b28afd60d6 100644 (file)
@@ -1165,7 +1165,10 @@ bool GVN::processLoad(LoadInst *L, SmallVectorImpl<Instruction*> &toErase) {
       WriteAsOperand(*DOUT.stream(), L);
       Instruction *I = dep.getInst();
       DOUT << " is clobbered by " << I->getOpcodeName() << " instruction ";
-      WriteAsOperand(*DOUT.stream(), I, false);
+      if (I->getType()->isFirstClassType())
+        WriteAsOperand(*DOUT.stream(), I, false);
+      else
+        DOUT << *I;
       DOUT << "\n";
     );
     return false;