Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1255303004: Add -reorder-basic-blocks option and fix nop insertion (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: rebase to master branch Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceClFlags.cpp ('k') | tests_lit/llvm2ice_tests/nop-insertion.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86BaseImpl.h
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
index b4c4ea3f5e3bb1101af09d89d844645daa2a286d..3c7ad5e66924f59501d901f09531401f2445c41d 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,9 +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 is enabled.
+ Func->doNopInsertion();
// Mark nodes that require sandbox alignment
if (Ctx->getFlags().getUseSandboxing())
@@ -446,10 +448,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 is enabled.
+ Func->doNopInsertion();
// Mark nodes that require sandbox alignment
if (Ctx->getFlags().getUseSandboxing())
« no previous file with comments | « src/IceClFlags.cpp ('k') | tests_lit/llvm2ice_tests/nop-insertion.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698