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

Side by Side Diff: src/IceCfgNode.cpp

Issue 1890283002: Subzero, Wasm: Link and run torture tests; bug fixes. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Merging with master Created 4 years, 8 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // have to be built up incrementally. After the CFG has been constructed, the 77 // have to be built up incrementally. After the CFG has been constructed, the
78 // computePredecessors() pass finalizes it by creating the InEdges list. 78 // computePredecessors() pass finalizes it by creating the InEdges list.
79 void CfgNode::computePredecessors() { 79 void CfgNode::computePredecessors() {
80 for (CfgNode *Succ : OutEdges) 80 for (CfgNode *Succ : OutEdges)
81 Succ->InEdges.push_back(this); 81 Succ->InEdges.push_back(this);
82 } 82 }
83 83
84 void CfgNode::computeSuccessors() { 84 void CfgNode::computeSuccessors() {
85 OutEdges.clear(); 85 OutEdges.clear();
86 InEdges.clear(); 86 InEdges.clear();
87 assert(!Insts.empty());
87 OutEdges = Insts.rbegin()->getTerminatorEdges(); 88 OutEdges = Insts.rbegin()->getTerminatorEdges();
88 } 89 }
89 90
90 // Ensure each Phi instruction in the node is consistent with respect to control 91 // Ensure each Phi instruction in the node is consistent with respect to control
91 // flow. For each predecessor, there must be a phi argument with that label. 92 // flow. For each predecessor, there must be a phi argument with that label.
92 // If a phi argument's label doesn't appear in the predecessor list (which can 93 // If a phi argument's label doesn't appear in the predecessor list (which can
93 // happen as a result of e.g. unreachable node elimination), its value is 94 // happen as a result of e.g. unreachable node elimination), its value is
94 // modified to be zero, to maintain consistency in liveness analysis. This 95 // modified to be zero, to maintain consistency in liveness analysis. This
95 // allows us to remove some dead control flow without a major rework of the phi 96 // allows us to remove some dead control flow without a major rework of the phi
96 // instructions. We don't check that phi arguments with the same label have the 97 // instructions. We don't check that phi arguments with the same label have the
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 auto *Instr = InstIntrinsicCall::create( 1466 auto *Instr = InstIntrinsicCall::create(
1466 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info); 1467 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info);
1467 Instr->addArg(AtomicRMWOp); 1468 Instr->addArg(AtomicRMWOp);
1468 Instr->addArg(Counter); 1469 Instr->addArg(Counter);
1469 Instr->addArg(One); 1470 Instr->addArg(One);
1470 Instr->addArg(OrderAcquireRelease); 1471 Instr->addArg(OrderAcquireRelease);
1471 Insts.push_front(Instr); 1472 Insts.push_front(Instr);
1472 } 1473 }
1473 1474
1474 } // end of namespace Ice 1475 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/WasmTranslator.cpp » ('j') | src/WasmTranslator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698