Index: src/IceTargetLoweringX86BaseImpl.h |
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h |
index 046d88f7263c9424a0097497d92748bd0c4bfce4..e665cb2470e77e9bd3022b2ba592fb9c4d4f6651 100644 |
--- a/src/IceTargetLoweringX86BaseImpl.h |
+++ b/src/IceTargetLoweringX86BaseImpl.h |
@@ -400,6 +400,9 @@ template <class Machine> void TargetX86Base<Machine>::translateO2() { |
Func->contractEmptyNodes(); |
Func->reorderNodes(); |
+ // Shuffle basic block order if -reorder-basic-blocks is enabled. |
+ Func->shuffleNodes(); |
+ |
// Branch optimization. This needs to be done just before code emission. In |
// particular, no transformations that insert or reorder CfgNodes should be |
// done after branch optimization. We go ahead and do it before nop insertion |
@@ -407,10 +410,8 @@ template <class Machine> void TargetX86Base<Machine>::translateO2() { |
Func->doBranchOpt(); |
Func->dump("After branch optimization"); |
- // Nop insertion |
- if (Ctx->getFlags().shouldDoNopInsertion()) { |
- Func->doNopInsertion(); |
- } |
+ // Nop insertion if -nop-insertion iss enabled. |
+ Func->doNopInsertion(); |
} |
template <class Machine> void TargetX86Base<Machine>::translateOm1() { |
@@ -443,10 +444,11 @@ template <class Machine> void TargetX86Base<Machine>::translateOm1() { |
return; |
Func->dump("After stack frame mapping"); |
- // Nop insertion |
- if (Ctx->getFlags().shouldDoNopInsertion()) { |
- Func->doNopInsertion(); |
- } |
+ // Shuffle basic block order if -reorder-basic-blocks is enabled. |
+ Func->shuffleNodes(); |
+ |
+ // Nop insertion if -nop-insertion iss enabled. |
+ Func->doNopInsertion(); |
} |
inline bool canRMW(const InstArithmetic *Arith) { |