Loading mlir/parsers/qasm3/utils/symbol_table.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -103,14 +103,15 @@ void ScopedSymbolTable::evaluate_const_global(const std::string variable_name, } // Now create the Global Memref Op // Note: need to use Tensor type to init the GlobalMemrefOp; llvm::ArrayRef<int64_t> shaperef{}; mlir::DenseElementsAttr initial_attr; if (type.isa<mlir::IntegerType>()) { initial_attr = mlir::DenseElementsAttr::get( mlir::VectorType::get(shaperef, type), {(int64_t)ref}); mlir::RankedTensorType::get(shaperef, type), {(int64_t)ref}); } else { initial_attr = mlir::DenseElementsAttr::get( mlir::VectorType::get(shaperef, type), {ref}); mlir::RankedTensorType::get(shaperef, type), {ref}); } auto memref_type = mlir::MemRefType::get(shaperef, type); Loading mlir/parsers/qasm3/visitor_handlers/classical_types_handler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -445,7 +445,7 @@ antlrcpp::Any qasm3_visitor::visitBitDeclaration( std::vector<mlir::Value> initial_values, indices; for (int j = 0; j < size; j++) { initial_values.push_back(get_or_create_constant_integer_value( equals_expr[j] == '1' ? 1 : 0, location, result_type, symbol_table, equals_expr[j] == '1' ? 1 : 0, location, builder.getI1Type(), symbol_table, builder)); indices.push_back(get_or_create_constant_index_value( j, location, 64, symbol_table, builder)); Loading Loading
mlir/parsers/qasm3/utils/symbol_table.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -103,14 +103,15 @@ void ScopedSymbolTable::evaluate_const_global(const std::string variable_name, } // Now create the Global Memref Op // Note: need to use Tensor type to init the GlobalMemrefOp; llvm::ArrayRef<int64_t> shaperef{}; mlir::DenseElementsAttr initial_attr; if (type.isa<mlir::IntegerType>()) { initial_attr = mlir::DenseElementsAttr::get( mlir::VectorType::get(shaperef, type), {(int64_t)ref}); mlir::RankedTensorType::get(shaperef, type), {(int64_t)ref}); } else { initial_attr = mlir::DenseElementsAttr::get( mlir::VectorType::get(shaperef, type), {ref}); mlir::RankedTensorType::get(shaperef, type), {ref}); } auto memref_type = mlir::MemRefType::get(shaperef, type); Loading
mlir/parsers/qasm3/visitor_handlers/classical_types_handler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -445,7 +445,7 @@ antlrcpp::Any qasm3_visitor::visitBitDeclaration( std::vector<mlir::Value> initial_values, indices; for (int j = 0; j < size; j++) { initial_values.push_back(get_or_create_constant_integer_value( equals_expr[j] == '1' ? 1 : 0, location, result_type, symbol_table, equals_expr[j] == '1' ? 1 : 0, location, builder.getI1Type(), symbol_table, builder)); indices.push_back(get_or_create_constant_index_value( j, location, 64, symbol_table, builder)); Loading