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

Unified Diff: src/IceCfgNode.cpp

Issue 463563006: Subzero: Randomly insert nops. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Fix insertion strategy Created 6 years, 4 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/IceInstX8632.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 22915b2f37bbe9f72ca06d10bfba912302543a0a..696a2f0b87ad9fb948535f3ded3d0ece2a0ccfe2 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -191,6 +191,24 @@ void CfgNode::doAddressOpt() {
}
}
+void CfgNode::doNopInsertion() {
+ TargetLowering *Target = Func->getTarget();
+ LoweringContext &Context = Target->getContext();
+ Context.init(this);
+ while (!Context.atEnd()) {
+ Target->doNopInsertion();
+ // Ensure Cur=Next, so that the nops are inserted before the current
+ // instruction rather than after.
+ Context.advanceNext();
+ Context.advanceCur();
+ }
+ // Insert before all instructions.
+ Context.setInsertPoint(getInsts().begin());
+ Context.advanceNext();
+ Context.advanceCur();
+ Target->doNopInsertion();
+}
+
// Drives the target lowering. Passes the current instruction and the
// next non-deleted instruction for target lowering.
void CfgNode::genCode() {
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698