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

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: fix comments 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
Index: src/IceTargetLoweringX86BaseImpl.h
diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h
index 77048b089c1a4c9934568f8dd973429138e36f9c..2bc2386bf82890dbe8d15243b59d677b7eb4714a 100644
--- a/src/IceTargetLoweringX86BaseImpl.h
+++ b/src/IceTargetLoweringX86BaseImpl.h
@@ -406,6 +406,12 @@ template <class Machine> void TargetX86Base<Machine>::translateO2() {
Func->contractEmptyNodes();
Func->reorderNodes();
+ // Shuffle basic block order if -reorder-basic-blocks is enabled.
Jim Stichnoth 2015/07/30 16:30:51 Call Func->shuffleNodes() unconditionally, and che
qining 2015/07/30 20:25:55 Done. Done the same with nop insertion.
+ if (Ctx->getFlags().shouldReorderBasicBlocks()) {
+ Func->shuffleNodes();
+ Func->dump("After basic block shuffling");
+ }
+
// 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
@@ -449,6 +455,12 @@ template <class Machine> void TargetX86Base<Machine>::translateOm1() {
return;
Func->dump("After stack frame mapping");
+ // Shuffle basic block order if -reorder-basic-blocks is enabled.
+ if (Ctx->getFlags().shouldReorderBasicBlocks()) {
+ Func->shuffleNodes();
+ Func->dump("After basic block shuffling");
+ }
+
// Nop insertion
if (Ctx->getFlags().shouldDoNopInsertion()) {
Func->doNopInsertion();

Powered by Google App Engine
This is Rietveld 408576698