//===-- GCSE.cpp - SSA based Global Common Subexpr Elimination ------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This pass is designed to be a very quick global transformation that
// eliminates global common subexpressions from a function. It does this by
// Erase the instruction from the program.
I->getParent()->getInstList().erase(I);
+ WorkList.erase(I);
}
return true;
Instruction *Ret = 0;
if (BB1 == BB2) {
- // Eliminate the second occuring instruction. Add all uses of the second
+ // Eliminate the second occurring instruction. Add all uses of the second
// instruction to the worklist.
//
// Scan the basic block looking for the "first" instruction
// ... X+Y ...
// }
//
- // In thiscase, the expression would be hoisted to outside the 'if' stmt,
+ // In this case, the expression would be hoisted to outside the 'if' stmt,
// causing the expression to be evaluated, even for the if (d) path, which
// could cause problems, if, for example, it caused a divide by zero. In
// general the problem this case is trying to solve is better addressed with