| 128 | } |
| 129 | |
| 130 | Status LoopEmitter::EmitLoop(absl::string_view loop_name, |
| 131 | llvm::Type* index_type) { |
| 132 | if (index_type == nullptr) { |
| 133 | index_type = b_->getInt64Ty(); |
| 134 | } |
| 135 | |
| 136 | for (const IrArray::Index& array_index : |
| 137 | EmitIndexAndSetExitBasicBlock(loop_name, index_type, |
| 138 | /*base_index*/nullptr)) { |
| 139 | TF_RETURN_IF_ERROR(body_emitter_(array_index)); |
| 140 | } |
| 141 | |
| 142 | // Set the insertion point of b_ to the loop exit, so that |
| 143 | // code emitted for later instructions will be correctly placed. |
| 144 | if (exit_bb_ != nullptr) { |
| 145 | b_->SetInsertPoint(exit_bb_); |
| 146 | } |
| 147 | return Status::OK(); |
| 148 | } |
| 149 | |
| 150 | } // namespace llvm_ir |
| 151 | } // namespace xla |
no outgoing calls
no test coverage detected