[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp Reassociate.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Feb 24 14:49:02 PST 2003
Changes in directory llvm/lib/Transforms/Scalar:
ADCE.cpp updated: 1.49 -> 1.50
Reassociate.cpp updated: 1.15 -> 1.16
---
Log message:
Rename Instruction::hasSideEffects() -> mayWriteToMemory()
---
Diffs of the changes:
Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.49 llvm/lib/Transforms/Scalar/ADCE.cpp:1.50
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.49 Wed Jan 22 20:12:18 2003
+++ llvm/lib/Transforms/Scalar/ADCE.cpp Mon Feb 24 14:48:30 2003
@@ -154,7 +154,7 @@
BBI != BBE; ++BBI) {
BasicBlock *BB = *BBI;
for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) {
- if (II->hasSideEffects() || II->getOpcode() == Instruction::Ret) {
+ if (II->mayWriteToMemory() || II->getOpcode() == Instruction::Ret) {
markInstructionLive(II);
++II; // Increment the inst iterator if the inst wasn't deleted
} else if (isInstructionTriviallyDead(II)) {
Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.15 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.16
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.15 Sat Dec 14 21:56:00 2002
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp Mon Feb 24 14:48:30 2003
@@ -74,7 +74,7 @@
if (I->getOpcode() == Instruction::PHINode ||
I->getOpcode() == Instruction::Alloca ||
I->getOpcode() == Instruction::Malloc || isa<TerminatorInst>(I) ||
- I->hasSideEffects())
+ I->mayWriteToMemory()) // Cannot move inst if it writes to memory!
return RankMap[I->getParent()];
unsigned &CachedRank = InstRankMap[I];
More information about the llvm-commits
mailing list