| OLD | NEW |
| 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 // This file implements the CfgNode class, including the complexities | 10 // This file implements the CfgNode class, including the complexities |
| 11 // of instruction insertion and in-edge calculation. | 11 // of instruction insertion and in-edge calculation. |
| 12 // | 12 // |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #include "assembler.h" | 15 #include "IceAssembler.h" |
| 16 #include "IceCfg.h" | 16 #include "IceCfg.h" |
| 17 #include "IceCfgNode.h" | 17 #include "IceCfgNode.h" |
| 18 #include "IceGlobalInits.h" | 18 #include "IceGlobalInits.h" |
| 19 #include "IceInst.h" | 19 #include "IceInst.h" |
| 20 #include "IceLiveness.h" | 20 #include "IceLiveness.h" |
| 21 #include "IceOperand.h" | 21 #include "IceOperand.h" |
| 22 #include "IceTargetLowering.h" | 22 #include "IceTargetLowering.h" |
| 23 | 23 |
| 24 namespace Ice { | 24 namespace Ice { |
| 25 | 25 |
| (...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 }; | 1055 }; |
| 1056 | 1056 |
| 1057 } // end of anonymous namespace | 1057 } // end of anonymous namespace |
| 1058 | 1058 |
| 1059 void CfgNode::emitIAS(Cfg *Func) const { | 1059 void CfgNode::emitIAS(Cfg *Func) const { |
| 1060 Func->setCurrentNode(this); | 1060 Func->setCurrentNode(this); |
| 1061 Assembler *Asm = Func->getAssembler<>(); | 1061 Assembler *Asm = Func->getAssembler<>(); |
| 1062 // TODO(stichnot): When sandboxing, defer binding the node label | 1062 // TODO(stichnot): When sandboxing, defer binding the node label |
| 1063 // until just before the first instruction is emitted, to reduce the | 1063 // until just before the first instruction is emitted, to reduce the |
| 1064 // chance that a padding nop is a branch target. | 1064 // chance that a padding nop is a branch target. |
| 1065 Asm->BindCfgNodeLabel(getIndex()); | 1065 Asm->bindCfgNodeLabel(getIndex()); |
| 1066 for (const Inst &I : Phis) { | 1066 for (const Inst &I : Phis) { |
| 1067 if (I.isDeleted()) | 1067 if (I.isDeleted()) |
| 1068 continue; | 1068 continue; |
| 1069 // Emitting a Phi instruction should cause an error. | 1069 // Emitting a Phi instruction should cause an error. |
| 1070 I.emitIAS(Func); | 1070 I.emitIAS(Func); |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 // Do the simple emission if not sandboxed. | 1073 // Do the simple emission if not sandboxed. |
| 1074 if (!Func->getContext()->getFlags().getUseSandboxing()) { | 1074 if (!Func->getContext()->getFlags().getUseSandboxing()) { |
| 1075 for (const Inst &I : Insts) { | 1075 for (const Inst &I : Insts) { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 InstIntrinsicCall *Inst = InstIntrinsicCall::create( | 1265 InstIntrinsicCall *Inst = InstIntrinsicCall::create( |
| 1266 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info); | 1266 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info); |
| 1267 Inst->addArg(AtomicRMWOp); | 1267 Inst->addArg(AtomicRMWOp); |
| 1268 Inst->addArg(Counter); | 1268 Inst->addArg(Counter); |
| 1269 Inst->addArg(One); | 1269 Inst->addArg(One); |
| 1270 Inst->addArg(OrderAcquireRelease); | 1270 Inst->addArg(OrderAcquireRelease); |
| 1271 Insts.push_front(Inst); | 1271 Insts.push_front(Inst); |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 } // end of namespace Ice | 1274 } // end of namespace Ice |
| OLD | NEW |