Don't bother value numbering instructions with void types in GVN. In theory this...
authorOwen Anderson <resistor@mac.com>
Tue, 4 Jan 2011 22:15:21 +0000 (22:15 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 4 Jan 2011 22:15:21 +0000 (22:15 +0000)
fewer things into the value numbering maps, but any speedup is beneath the noise threshold on my machine
on 403.gcc.

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

lib/Transforms/Scalar/GVN.cpp

index 010d6c9fdf214cb4285e512531899bf945d559f1..b7fc9c30e06d6a3b3e1f542a0023046bff432535 100644 (file)
@@ -1685,6 +1685,10 @@ bool GVN::processInstruction(Instruction *I,
     return false;
   }
   
+  // Instructions with void type don't return a value, so there's
+  // no point in trying to find redudancies in them.
+  if (I->getType()->isVoidTy()) return false;
+  
   uint32_t NextNum = VN.getNextUnusedValueNumber();
   unsigned Num = VN.lookup_or_add(I);