Loading mlir/parsers/qasm3/utils/expression_handler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -505,8 +505,12 @@ antlrcpp::Any qasm3_expression_generator::visitXOrExpression( auto mem_type = mlir::MemRefType::get(shaperef, lhs_element_type); auto integer_attr2 = mlir::IntegerAttr::get(lhs_element_type, 0); assert(integer_attr2.getType().cast<mlir::IntegerType>().isSignless()); auto ret2 = builder.create<mlir::ConstantOp>(location, integer_attr2); auto integer_attr3 = mlir::IntegerAttr::get(lhs_element_type, 1); assert(integer_attr3.getType().cast<mlir::IntegerType>().isSignless()); auto ret3 = builder.create<mlir::ConstantOp>(location, integer_attr3); mlir::Value loop_var_memref = builder.create<mlir::AllocaOp>( Loading Loading @@ -774,6 +778,7 @@ antlrcpp::Any qasm3_expression_generator::visitExpressionTerminator( ? internal_value_type.cast<mlir::IntegerType>() : builder.getI64Type()), idx); assert(integer_attr.getType().cast<mlir::IntegerType>().isSignless()); current_value = builder.create<mlir::ConstantOp>(location, integer_attr); } return 0; Loading mlir/parsers/qasm3/utils/qasm3_utils.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ mlir::Value get_or_create_constant_integer_value( return symbol_table.get_constant_integer(idx, width); } else { auto integer_attr = mlir::IntegerAttr::get(type, idx); assert(integer_attr.getType().cast<mlir::IntegerType>().isSignless()); auto ret = builder.create<mlir::ConstantOp>(location, integer_attr); symbol_table.add_constant_integer(idx, ret, width); return ret; Loading mlir/parsers/qasm3/visitor_handlers/classical_types_handler.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,7 @@ antlrcpp::Any qasm3_visitor::visitNoDesignatorDeclaration( if (auto id_list = context->identifierList()) { for (auto id : id_list->Identifier()) { variable_names.push_back(id->getText()); assert(init_attr.getType().cast<mlir::IntegerType>().isSignless()); initial_values.push_back( builder.create<mlir::ConstantOp>(location, init_attr)); } Loading Loading
mlir/parsers/qasm3/utils/expression_handler.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -505,8 +505,12 @@ antlrcpp::Any qasm3_expression_generator::visitXOrExpression( auto mem_type = mlir::MemRefType::get(shaperef, lhs_element_type); auto integer_attr2 = mlir::IntegerAttr::get(lhs_element_type, 0); assert(integer_attr2.getType().cast<mlir::IntegerType>().isSignless()); auto ret2 = builder.create<mlir::ConstantOp>(location, integer_attr2); auto integer_attr3 = mlir::IntegerAttr::get(lhs_element_type, 1); assert(integer_attr3.getType().cast<mlir::IntegerType>().isSignless()); auto ret3 = builder.create<mlir::ConstantOp>(location, integer_attr3); mlir::Value loop_var_memref = builder.create<mlir::AllocaOp>( Loading Loading @@ -774,6 +778,7 @@ antlrcpp::Any qasm3_expression_generator::visitExpressionTerminator( ? internal_value_type.cast<mlir::IntegerType>() : builder.getI64Type()), idx); assert(integer_attr.getType().cast<mlir::IntegerType>().isSignless()); current_value = builder.create<mlir::ConstantOp>(location, integer_attr); } return 0; Loading
mlir/parsers/qasm3/utils/qasm3_utils.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,7 @@ mlir::Value get_or_create_constant_integer_value( return symbol_table.get_constant_integer(idx, width); } else { auto integer_attr = mlir::IntegerAttr::get(type, idx); assert(integer_attr.getType().cast<mlir::IntegerType>().isSignless()); auto ret = builder.create<mlir::ConstantOp>(location, integer_attr); symbol_table.add_constant_integer(idx, ret, width); return ret; Loading
mlir/parsers/qasm3/visitor_handlers/classical_types_handler.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,7 @@ antlrcpp::Any qasm3_visitor::visitNoDesignatorDeclaration( if (auto id_list = context->identifierList()) { for (auto id : id_list->Identifier()) { variable_names.push_back(id->getText()); assert(init_attr.getType().cast<mlir::IntegerType>().isSignless()); initial_values.push_back( builder.create<mlir::ConstantOp>(location, init_attr)); } Loading