Do not attempt to do parial redundancy elimination on void values.

Also fixed a punctuation error in the header comment.
This fixes PR3775.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
John Criswell
2009-03-10 15:04:53 +00:00
parent ff7d0e9509
commit 090c0a2ffd
2 changed files with 86 additions and 3 deletions
+4 -3
View File
@@ -10,7 +10,7 @@
// This pass performs global value numbering to eliminate fully redundant
// instructions. It also performs simple dead load elimination.
//
// Note that this pass does the value numbering itself, it does not use the
// Note that this pass does the value numbering itself; it does not use the
// ValueNumbering analysis passes.
//
//===----------------------------------------------------------------------===//
@@ -1469,8 +1469,9 @@ bool GVN::performPRE(Function& F) {
Instruction *CurInst = BI++;
if (isa<AllocationInst>(CurInst) || isa<TerminatorInst>(CurInst) ||
isa<PHINode>(CurInst) || CurInst->mayReadFromMemory() ||
CurInst->mayWriteToMemory() || isa<DbgInfoIntrinsic>(CurInst))
isa<PHINode>(CurInst) || (CurInst->getType() == Type::VoidTy) ||
CurInst->mayReadFromMemory() || CurInst->mayWriteToMemory() ||
isa<DbgInfoIntrinsic>(CurInst))
continue;
uint32_t valno = VN.lookup(CurInst);