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

Unified Diff: src/IceCfgNode.cpp

Issue 580903005: Subzero: Add branch optimization. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes 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
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.cpp
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index 4de2f577db3c4cbaedbf0939947b8d20fb08e3e1..57aba6b29ee9e14fb7abe9054ada7c7202c68f0d 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -457,6 +457,19 @@ void CfgNode::livenessPostprocess(LivenessMode Mode, Liveness *Liveness) {
}
}
+void CfgNode::doBranchOpt(const CfgNode *NextNode) {
+ TargetLowering *Target = Func->getTarget();
+ // Check every instruction for a branch optimization opportunity.
+ // It may be more efficient to iterate in reverse and stop after the
+ // first opportunity, unless there is some target lowering where we
+ // have the possibility of multiple such optimizations per block
+ // (currently not the case for x86 lowering).
+ for (InstList::const_iterator I = Insts.begin(), E = Insts.end(); I != E;
+ ++I) {
+ Target->doBranchOpt(*I, NextNode);
+ }
+}
+
// ======================== Dump routines ======================== //
void CfgNode::emit(Cfg *Func) const {
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698