aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-05-31 18:03:39 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-05-31 18:03:39 +0000
commit4c6f2f9e92eae3e676ee09133e9666567782faa3 (patch)
tree6c7727d834531ea915a6b3d596be6a8b9c3d003a
parent8874aaef1dcab6a05e60de2d3fdf478bb0ea73df (diff)
downloadexternal_llvm-4c6f2f9e92eae3e676ee09133e9666567782faa3.zip
external_llvm-4c6f2f9e92eae3e676ee09133e9666567782faa3.tar.gz
external_llvm-4c6f2f9e92eae3e676ee09133e9666567782faa3.tar.bz2
commuteInstruction() does not always create a new MI!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28592 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index d2820d9..1d15401 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -402,8 +402,10 @@ void ScheduleDAG::EmitNode(SDNode *Node,
DEBUG(std::cerr << "Sched: COMMUTING FAILED!\n");
else {
DEBUG(std::cerr << "Sched: COMMUTED TO: " << *NewMI);
- delete MI;
- MI = NewMI;
+ if (MI != NewMI) {
+ delete MI;
+ MI = NewMI;
+ }
}
}