Rename Instruction::hasSideEffects() -> mayWriteToMemory()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5620 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 24ccee6..e7bc135 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -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)) {
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp
index 4212e6a..df0a641 100644
--- a/lib/Transforms/Scalar/Reassociate.cpp
+++ b/lib/Transforms/Scalar/Reassociate.cpp
@@ -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];
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 10028ba..8f67e11 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -91,7 +91,7 @@
 //
 
 bool isInstructionTriviallyDead(Instruction *I) {
-  return I->use_empty() && !I->hasSideEffects() && !isa<TerminatorInst>(I);
+  return I->use_empty() && !I->mayWriteToMemory() && !isa<TerminatorInst>(I);
 }
 
 // dceInstruction - Inspect the instruction at *BBI and figure out if it's