Run machine licm before machine cse to avoid messing up licm opportunities.
llvm-svn: 97752
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 33d37f7..abf183c 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -320,10 +320,10 @@
if (OptLevel != CodeGenOpt::None) {
PM.add(createOptimizeExtsPass());
- if (EnableMachineCSE)
- PM.add(createMachineCSEPass());
if (!DisableMachineLICM)
PM.add(createMachineLICMPass());
+ if (EnableMachineCSE)
+ PM.add(createMachineCSEPass());
if (!DisableMachineSink)
PM.add(createMachineSinkingPass());
printAndVerify(PM, "After MachineLICM and MachineSinking",