| OLD | NEW |
| 1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// | 1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// |
| 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 LLVM to ICE converter. | 10 // This file implements the LLVM to ICE converter. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 // Make an initial pass through the block list just to resolve the | 107 // Make an initial pass through the block list just to resolve the |
| 108 // blocks in the original linearized order. Otherwise the ICE | 108 // blocks in the original linearized order. Otherwise the ICE |
| 109 // linearized order will be affected by branch targets in | 109 // linearized order will be affected by branch targets in |
| 110 // terminator instructions. | 110 // terminator instructions. |
| 111 for (const BasicBlock &BBI : *F) | 111 for (const BasicBlock &BBI : *F) |
| 112 mapBasicBlockToNode(&BBI); | 112 mapBasicBlockToNode(&BBI); |
| 113 for (const BasicBlock &BBI : *F) | 113 for (const BasicBlock &BBI : *F) |
| 114 convertBasicBlock(&BBI); | 114 convertBasicBlock(&BBI); |
| 115 Func->setEntryNode(mapBasicBlockToNode(&F->getEntryBlock())); | 115 Func->setEntryNode(mapBasicBlockToNode(&F->getEntryBlock())); |
| 116 Func->computePredecessors(); | 116 Func->computeInOutEdges(); |
| 117 | 117 |
| 118 Ice::Cfg::setCurrentCfg(nullptr); | 118 Ice::Cfg::setCurrentCfg(nullptr); |
| 119 Converter.translateFcn(std::move(Func)); | 119 Converter.translateFcn(std::move(Func)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // convertConstant() does not use Func or require it to be a valid | 122 // convertConstant() does not use Func or require it to be a valid |
| 123 // Ice::Cfg pointer. As such, it's suitable for e.g. constructing | 123 // Ice::Cfg pointer. As such, it's suitable for e.g. constructing |
| 124 // global initializers. | 124 // global initializers. |
| 125 Ice::Constant *convertConstant(const Constant *Const) { | 125 Ice::Constant *convertConstant(const Constant *Const) { |
| 126 if (const auto GV = dyn_cast<GlobalValue>(Const)) { | 126 if (const auto GV = dyn_cast<GlobalValue>(Const)) { |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 Ctx->pushTimer(TimerID, StackID); | 902 Ctx->pushTimer(TimerID, StackID); |
| 903 } | 903 } |
| 904 LLVM2ICEFunctionConverter FunctionConverter(*this); | 904 LLVM2ICEFunctionConverter FunctionConverter(*this); |
| 905 FunctionConverter.convertFunction(&I); | 905 FunctionConverter.convertFunction(&I); |
| 906 if (TimeThisFunction) | 906 if (TimeThisFunction) |
| 907 Ctx->popTimer(TimerID, StackID); | 907 Ctx->popTimer(TimerID, StackID); |
| 908 } | 908 } |
| 909 } | 909 } |
| 910 | 910 |
| 911 } // end of namespace Ice | 911 } // end of namespace Ice |
| OLD | NEW |