Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 660680525
  • Loading branch information
XLS Team authored and copybara-github committed Aug 8, 2024
1 parent 4b27cbf commit 5417bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xls/jit/ir_builder_visitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2238,6 +2238,7 @@ absl::Status IrBuilderVisitor::HandleInvoke(Invoke* invoke) {

llvm::Value* output_buffer = node_context.GetOutputPtr(0);
std::vector<llvm::Value*> operand_ptrs;
operand_ptrs.reserve(invoke->operand_count());
for (int64_t i = 0; i < invoke->operand_count(); ++i) {
operand_ptrs.push_back(node_context.GetOperandPtr(i));
}
Expand Down Expand Up @@ -3043,6 +3044,7 @@ absl::Status IrBuilderVisitor::HandleNaryOp(
NewNodeIrContext(node,
NumberedStrings("operand", node->operand_count())));
std::vector<llvm::Value*> args;
args.reserve(node->operand_count());
for (int64_t i = 0; i < node->operand_count(); ++i) {
args.push_back(node_context.LoadOperand(i));
}
Expand Down
2 changes: 2 additions & 0 deletions xls/jit/type_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Value TypeLayout::NativeLayoutToValueInternal(Type* element_type,
if (element_type->IsTuple()) {
TupleType* tuple_type = element_type->AsTupleOrDie();
std::vector<Value> elements;
elements.reserve(tuple_type->size());
for (int64_t i = 0; i < tuple_type->size(); ++i) {
elements.push_back(NativeLayoutToValueInternal(
tuple_type->element_type(i), buffer, leaf_index));
Expand All @@ -137,6 +138,7 @@ Value TypeLayout::NativeLayoutToValueInternal(Type* element_type,
CHECK(element_type->IsArray());
ArrayType* array_type = element_type->AsArrayOrDie();
std::vector<Value> elements;
elements.reserve(array_type->size());
for (int64_t i = 0; i < array_type->size(); ++i) {
elements.push_back(NativeLayoutToValueInternal(array_type->element_type(),
buffer, leaf_index));
Expand Down

0 comments on commit 5417bcf

Please sign in to comment.