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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 580903005: Subzero: Add branch optimization. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Avoid the !! operator Created 6 years, 3 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/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 464a2e88a91260686a086eb91a6016eb1cf92dcc..ad687c82533940d68bb5ec946ed66c4e201548f9 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -399,6 +399,12 @@ void TargetX8632::translateO2() {
if (shouldDoNopInsertion()) {
Func->doNopInsertion();
}
+
+ // Branch optimization. This needs to be done just before code
jvoung (off chromium) 2014/09/18 03:56:02 Should this be before nop insertion? I don't think
Jim Stichnoth 2014/09/18 11:45:51 Good point, done.
+ // emission. In particular, no transformations that insert or
+ // reorder CfgNodes should be done after branch optimization.
+ Func->doBranchOpt();
+ Func->dump("After branch optimization");
}
void TargetX8632::translateOm1() {
@@ -444,6 +450,12 @@ void TargetX8632::translateOm1() {
}
}
+void TargetX8632::doBranchOpt(Inst *I, const CfgNode *NextNode) {
+ if (InstX8632Br *Br = llvm::dyn_cast<InstX8632Br>(I)) {
+ Br->optimizeBranch(NextNode);
+ }
+}
+
IceString TargetX8632::RegNames[] = {
#define X(val, init, name, name16, name8, scratch, preserved, stackptr, \
frameptr, isI8, isInt, isFP) \
« src/IceCfgNode.cpp ('K') | « src/IceTargetLoweringX8632.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698