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

Side by Side Diff: src/IceCfgNode.cpp

Issue 1300993002: Use separate random number generator for each randomization pass (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Minor change in GlobalContext::getJumpTables(), make jump tables in deterministic order even pooled… Created 5 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 unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 // instruction and delete the old. 489 // instruction and delete the old.
490 void CfgNode::doAddressOpt() { 490 void CfgNode::doAddressOpt() {
491 TargetLowering *Target = Func->getTarget(); 491 TargetLowering *Target = Func->getTarget();
492 LoweringContext &Context = Target->getContext(); 492 LoweringContext &Context = Target->getContext();
493 Context.init(this); 493 Context.init(this);
494 while (!Context.atEnd()) { 494 while (!Context.atEnd()) {
495 Target->doAddressOpt(); 495 Target->doAddressOpt();
496 } 496 }
497 } 497 }
498 498
499 void CfgNode::doNopInsertion() { 499 void CfgNode::doNopInsertion(RandomNumberGenerator &RNG) {
500 TargetLowering *Target = Func->getTarget(); 500 TargetLowering *Target = Func->getTarget();
501 LoweringContext &Context = Target->getContext(); 501 LoweringContext &Context = Target->getContext();
502 Context.init(this); 502 Context.init(this);
503 Context.setInsertPoint(Context.getCur()); 503 Context.setInsertPoint(Context.getCur());
504 // Do not insert nop in bundle locked instructions. 504 // Do not insert nop in bundle locked instructions.
505 bool PauseNopInsertion = false; 505 bool PauseNopInsertion = false;
506 while (!Context.atEnd()) { 506 while (!Context.atEnd()) {
507 if (llvm::isa<InstBundleLock>(Context.getCur())) { 507 if (llvm::isa<InstBundleLock>(Context.getCur())) {
508 PauseNopInsertion = true; 508 PauseNopInsertion = true;
509 } else if (llvm::isa<InstBundleUnlock>(Context.getCur())) { 509 } else if (llvm::isa<InstBundleUnlock>(Context.getCur())) {
510 PauseNopInsertion = false; 510 PauseNopInsertion = false;
511 } 511 }
512 if (!PauseNopInsertion) 512 if (!PauseNopInsertion)
513 Target->doNopInsertion(); 513 Target->doNopInsertion(RNG);
514 // Ensure Cur=Next, so that the nops are inserted before the current 514 // Ensure Cur=Next, so that the nops are inserted before the current
515 // instruction rather than after. 515 // instruction rather than after.
516 Context.advanceCur(); 516 Context.advanceCur();
517 Context.advanceNext(); 517 Context.advanceNext();
518 } 518 }
519 } 519 }
520 520
521 // Drives the target lowering. Passes the current instruction and the 521 // Drives the target lowering. Passes the current instruction and the
522 // next non-deleted instruction for target lowering. 522 // next non-deleted instruction for target lowering.
523 void CfgNode::genCode() { 523 void CfgNode::genCode() {
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 InstIntrinsicCall *Inst = InstIntrinsicCall::create( 1277 InstIntrinsicCall *Inst = InstIntrinsicCall::create(
1278 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info); 1278 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info);
1279 Inst->addArg(AtomicRMWOp); 1279 Inst->addArg(AtomicRMWOp);
1280 Inst->addArg(Counter); 1280 Inst->addArg(Counter);
1281 Inst->addArg(One); 1281 Inst->addArg(One);
1282 Inst->addArg(OrderAcquireRelease); 1282 Inst->addArg(OrderAcquireRelease);
1283 Insts.push_front(Inst); 1283 Insts.push_front(Inst);
1284 } 1284 }
1285 1285
1286 } // end of namespace Ice 1286 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceDefs.h » ('j') | src/IceGlobalContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698