Commit 62488e66 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

More MLIR type fixes for unit tests with optimization



Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
parent 50595988
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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));