Skip to content

Commit

Permalink
Fix quake.alloca. Get rid of the redundant, unnecessary, and confusing
Browse files Browse the repository at this point in the history
extra size argument when it is not needed. Change the syntax from the
reverse Polish notation to a more natural C/C++ style. Fix all the
tests. Simplify the verifier since gratuitous redundancy is not allowed.
  • Loading branch information
schweitzpgi committed May 25, 2023
1 parent f293938 commit 69472c9
Show file tree
Hide file tree
Showing 47 changed files with 128 additions and 120 deletions.
5 changes: 4 additions & 1 deletion include/cudaq/Optimizer/Dialect/Quake/QuakeOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ def quake_AllocaOp : QuakeOp<"alloca", [MemoryEffects<[MemAlloc, MemWrite]>]> {
}]>,
OpBuilder<(ins "size_t":$size), [{
return build($_builder, $_state, $_builder.getType<VeqType>(size), {});
}]>,
OpBuilder<(ins "mlir::Type":$ty), [{
return build($_builder, $_state, ty, {});
}]>
];

let assemblyFormat = [{
(`[` $size^ `:` type($size)`]`)? qualified(type($ref_or_vec)) attr-dict
qualified(type($ref_or_vec)) (`[` $size^ `:` type($size) `]`)? attr-dict
}];

let hasCanonicalizer = 1;
Expand Down
9 changes: 5 additions & 4 deletions lib/Frontend/nvqpp/ConvertDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ bool QuakeBridgeVisitor::VisitVarDecl(clang::VarDecl *x) {
// this is a qreg<N> q;
auto qregSizeVal = builder.create<mlir::arith::ConstantIntOp>(
loc, qregSize, builder.getIntegerType(64));
qreg = builder.create<quake::AllocaOp>(loc, qType, qregSizeVal);
if (qregSize != 0)
qreg = builder.create<quake::AllocaOp>(loc, qType);
else
qreg = builder.create<quake::AllocaOp>(loc, qType, qregSizeVal);
}
symbolTable.insert(name, qreg);
// allocated_qreg_names.push_back(name);
Expand All @@ -267,12 +270,10 @@ bool QuakeBridgeVisitor::VisitVarDecl(clang::VarDecl *x) {
symbolTable.insert(name, val);
return pushValue(val);
}
auto qregSizeVal = builder.create<mlir::arith::ConstantIntOp>(
loc, 1, builder.getIntegerType(64));
auto zero = builder.create<mlir::arith::ConstantIntOp>(
loc, 0, builder.getIntegerType(64));
auto qregSizeOne = builder.create<quake::AllocaOp>(
loc, quake::VeqType::get(builder.getContext(), 1), qregSizeVal);
loc, quake::VeqType::get(builder.getContext(), 1));
Value addressTheQubit =
builder.create<quake::ExtractRefOp>(loc, qregSizeOne, zero);
symbolTable.insert(name, addressTheQubit);
Expand Down
4 changes: 4 additions & 0 deletions lib/Frontend/nvqpp/ConvertExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,11 +1718,15 @@ bool QuakeBridgeVisitor::VisitCXXConstructExpr(clang::CXXConstructExpr *x) {
auto sizeVal = popValue();
if (isa<quake::VeqType>(sizeVal.getType()))
return pushValue(sizeVal);
if (regTy.hasSpecifiedSize())
return pushValue(builder.create<quake::AllocaOp>(loc, regTy));
return pushValue(
builder.create<quake::AllocaOp>(loc, regTy, sizeVal));
}
auto qregSizeVal = builder.create<arith::ConstantIntOp>(
loc, regTy.getSize(), builder.getIntegerType(64));
if (regTy.hasSpecifiedSize())
return pushValue(builder.create<quake::AllocaOp>(loc, regTy));
return pushValue(
builder.create<quake::AllocaOp>(loc, regTy, qregSizeVal));
}
Expand Down
51 changes: 28 additions & 23 deletions lib/Optimizer/Dialect/Quake/QuakeOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,40 @@ Value quake::createConstantAlloca(PatternRewriter &builder, Location loc,
loc, quake::VeqType::getUnsized(builder.getContext()), newAlloca);
}

void quake::AllocaOp::getCanonicalizationPatterns(RewritePatternSet &patterns,
MLIRContext *context) {
patterns.add<FuseConstantToAllocaPattern>(context);
}

LogicalResult quake::AllocaOp::verify() {
auto resultType = dyn_cast<VeqType>(getResult().getType());
if (auto size = getSize()) {
std::int64_t argSize = 0;
if (auto cnt = dyn_cast_or_null<arith::ConstantOp>(size.getDefiningOp())) {
argSize = cnt.getValue().cast<IntegerAttr>().getInt();
// TODO: This is a questionable check. We could have a very large unsigned
// value that appears to be negative because of two's complement. On the
// other hand, allocating 2^64 - 1 qubits isn't going to go well.
if (argSize < 0)
return emitOpError("expected a non-negative integer size.");
// Result must be RefType or VeqType by construction.
if (auto resTy = dyn_cast<VeqType>(getResult().getType())) {
if (resTy.hasSpecifiedSize()) {
if (getSize())
return emitOpError("unexpected size operand");
} else {
if (auto size = getSize()) {
if (auto cnt =
dyn_cast_or_null<arith::ConstantOp>(size.getDefiningOp())) {
std::int64_t argSize = cnt.getValue().cast<IntegerAttr>().getInt();
// TODO: This is a questionable check. We could have a very large
// unsigned value that appears to be negative because of two's
// complement. On the other hand, allocating 2^64 - 1 qubits isn't
// going to go well.
if (argSize < 0)
return emitOpError("expected a non-negative integer size.");
}
} else {
return emitOpError("size operand required");
}
}
if (!resultType)
return emitOpError(
"must return a vector of qubits since a size was provided.");
if (resultType.hasSpecifiedSize() &&
(static_cast<std::size_t>(argSize) != resultType.getSize()))
return emitOpError("expected operand size to match VeqType size.");
} else if (resultType && !resultType.hasSpecifiedSize()) {
return emitOpError("must return a veq with known size.");
}
return success();
}

void quake::AllocaOp::getCanonicalizationPatterns(RewritePatternSet &patterns,
MLIRContext *context) {
// Use a canonicalization pattern as folding the constant into the veq type
// changes the type. Uses may still expect a veq with unspecified size.
// Folding is strictly reductive and doesn't allow the creation of ops.
patterns.add<FuseConstantToAllocaPattern>(context);
}

//===----------------------------------------------------------------------===//
// ExtractRef
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 1 addition & 1 deletion python/tests/compiler/adjoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def test_sample_adjoint_qreg():
# CHECK-SAME: %[[VAL_0:.*]]: i32) {
# CHECK: %[[VAL_1:.*]] = arith.constant 1 : index
# CHECK: %[[VAL_2:.*]] = arith.constant 0 : index
# CHECK: %[[VAL_3:.*]] = quake.alloca[%[[VAL_0]] : i32] !quake.veq<?>
# CHECK: %[[VAL_3:.*]] = quake.alloca !quake.veq<?>[%[[VAL_0]] : i32]
# CHECK: %[[VAL_4:.*]] = quake.vec_size %[[VAL_3]] : (!quake.veq<?>) -> i64
# CHECK: %[[VAL_5:.*]] = arith.index_cast %[[VAL_4]] : i64 to index
# CHECK: %[[VAL_6:.*]] = cc.loop while ((%[[VAL_7:.*]] = %[[VAL_2]]) -> (index)) {
Expand Down
2 changes: 1 addition & 1 deletion python/tests/compiler/qalloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_kernel_qalloc_quake_val():

# CHECK-LABEL: func.func @__nvqpp__mlirgen____nvqppBuilderKernel_{{.*}}(
# CHECK-SAME: %[[VAL_0:.*]]: i32) {
# CHECK: %[[VAL_1:.*]] = quake.alloca[%[[VAL_0]] : i32] !quake.veq<?>
# CHECK: %[[VAL_1:.*]] = quake.alloca !quake.veq<?>[%[[VAL_0]] : i32]
# CHECK: return
# CHECK: }

Expand Down
3 changes: 1 addition & 2 deletions test/AST-Quake/adjoint-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ struct ep {
};

// CHECK-LABEL: func.func @__nvqpp__mlirgen__ep()
// CHECK: %[[VAL_2:.*]] = arith.constant 3 : i64
// CHECK: %[[VAL_3:.*]] = quake.alloca[%[[VAL_2]] : i64] !quake.veq<3>
// CHECK: %[[VAL_3:.*]] = quake.alloca !quake.veq<3>
// CHECK: %[[VAL_4:.*]] = quake.relax_size %[[VAL_3]] : (!quake.veq<3>) -> !quake.veq<?>
// CHECK: quake.apply<adj> @__nvqpp__mlirgen__k %[[VAL_4]] : (!quake.veq<?>) -> ()
// CHECK: return
Expand Down
2 changes: 1 addition & 1 deletion test/AST-Quake/adjoint-3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct QernelZero {
// CHECK-LABEL: func.func @__nvqpp__mlirgen__run_circuit
// CHECK-SAME: (%{{.*}}: i32, %{{.*}}: i32, %{{.*}}: f64)
// CHECK: %[[VAL_5:.*]] = memref.alloca() : memref<f64>
// CHECK: %[[VAL_10:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_10:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_16:.*]] = memref.load %[[VAL_5]][] : memref<f64>
// CHECK: call @__nvqpp__mlirgen__statePrep_A{{.*}}(%[[VAL_10]], %[[VAL_16]]) : (!quake.veq<?>, f64) -> ()
// CHECK: cc.scope {
Expand Down
2 changes: 1 addition & 1 deletion test/AST-Quake/callable-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main() {
// CHECK-SAME: (%[[VAL_0:.*]]: !cc.lambda<(!quake.veq<?>) -> ()>) attributes {{{.*}}"cudaq-entrypoint"{{.*}}} {
// CHECK: %[[VAL_1:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_2:.*]] = arith.extsi %[[VAL_1]] : i32 to i64
// CHECK: %[[VAL_3:.*]] = quake.alloca[%[[VAL_2]] : i64] !quake.veq<?>
// CHECK: %[[VAL_3:.*]] = quake.alloca !quake.veq<?>[%[[VAL_2]] : i64]
// CHECK: call @__nvqpp__mlirgen__Z4mainE3$_0(%[[VAL_3]]) : (!quake.veq<?>) -> ()
// CHECK: return
// CHECK: }
Expand Down
2 changes: 1 addition & 1 deletion test/AST-Quake/compute_action-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct ctrlHeisenberg {
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.ref
// CHECK: %[[VAL_3:.*]] = memref.load %[[VAL_1]][] : memref<i32>
// CHECK: %[[VAL_4:.*]] = arith.extsi %[[VAL_3]] : i32 to i64
// CHECK: %[[VAL_5:.*]] = quake.alloca[%[[VAL_4]] : i64] !quake.veq<?>
// CHECK: %[[VAL_5:.*]] = quake.alloca !quake.veq<?>[%[[VAL_4]] : i64]
// CHECK: %[[VAL_6:.*]] = quake.concat %[[VAL_2]] : (!quake.ref) -> !quake.veq<?>
// CHECK: call @__nvqpp__mlirgen__function_magic_func.{{.*}}.ctrl(%[[VAL_6]], %[[VAL_5]]) : (!quake.veq<?>, !quake.veq<?>) -> ()
// CHECK: return
Expand Down
6 changes: 3 additions & 3 deletions test/AST-Quake/ctrl_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ struct lower_ctrl_as_qreg {
// CHECK-LABEL: func.func @__nvqpp__mlirgen__lower_ctrl_as_qreg
// CHECK-SAME: () attributes {{{.*}}"cudaq-entrypoint"{{.*}}} {
// CHECK: %[[VAL_0:.*]] = arith.constant 4 : i32
// CHECK: %[[VAL_2:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_3:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_5:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_5:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_6:.*]] = arith.constant 0 : i32
// CHECK: %[[VAL_8:.*]] = quake.extract_ref %[[VAL_5]][%{{.*}}] : (!quake.veq<?>, i64) -> !quake.ref
// CHECK: quake.h [%[[VAL_2]]] %[[VAL_8]] : (!quake.veq<?>, !quake.ref) -> ()
Expand Down Expand Up @@ -60,7 +60,7 @@ struct test_two_control_call {
// CHECK: }
// CHECK: } : !cc.lambda<(!quake.ref) -> ()>
// CHECK: %[[VAL_4:.*]] = arith.constant 4 : i64
// CHECK: %[[VAL_5:.*]] = quake.alloca[%[[VAL_4]] : i64] !quake.veq<4>
// CHECK: %[[VAL_5:.*]] = quake.alloca !quake.veq<4>
// CHECK: %[[VAL_6:.*]] = quake.alloca !quake.ref
// CHECK: quake.apply @__nvqpp__mlirgen__{{.*}}test_two_control_call{{.*}}[%[[VAL_5]]] %[[VAL_6]] : (!quake.veq<4>, !quake.ref) -> ()
// CHECK: %[[VAL_7:.*]] = quake.mz %[[VAL_6]] : (!quake.ref) -> i1
Expand Down
4 changes: 2 additions & 2 deletions test/AST-Quake/dealloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ __qpu__ void magic_func(int N) {

// CHECK-LABEL: func.func @__nvqpp__mlirgen__function_magic_func
// CHECK: cc.scope {
// CHECK: %[[VAL_4:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_4:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: quake.dealloc %[[VAL_4]] : !quake.veq<?>
// CHECK: cc.continue
// CHECK: }
// CHECK: %[[VAL_10:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_10:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: quake.dealloc %[[VAL_10]] : !quake.veq<?>
// CHECK: return
// CHECK: }
Expand Down
4 changes: 2 additions & 2 deletions test/AST-Quake/if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct kernel {
// CHECK: memref.store %[[VAL_0]], %[[VAL_1]][] : memref<i1>
// CHECK: %[[VAL_2:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_3:.*]] = arith.extsi %[[VAL_2]] : i32 to i64
// CHECK: %[[VAL_4:.*]] = quake.alloca[%[[VAL_3]] : i64] !quake.veq<?>
// CHECK: %[[VAL_4:.*]] = quake.alloca !quake.veq<?>[%[[VAL_3]] : i64]
// CHECK: %[[VAL_5:.*]] = memref.load %[[VAL_1]][] : memref<i1>
// CHECK: cc.if(%[[VAL_5]]) {
// CHECK: cc.scope {
Expand Down Expand Up @@ -63,7 +63,7 @@ struct kernel_else {
// CHECK: memref.store %[[VAL_0]], %[[VAL_1]][] : memref<i1>
// CHECK: %[[VAL_2:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_3:.*]] = arith.extsi %[[VAL_2]] : i32 to i64
// CHECK: %[[VAL_4:.*]] = quake.alloca[%[[VAL_3]] : i64] !quake.veq<?>
// CHECK: %[[VAL_4:.*]] = quake.alloca !quake.veq<?>[%[[VAL_3]] : i64]
// CHECK: %[[VAL_5:.*]] = memref.load %[[VAL_1]][] : memref<i1>
// CHECK: cc.if(%[[VAL_5]]) {
// CHECK: cc.scope {
Expand Down
12 changes: 5 additions & 7 deletions test/AST-Quake/lambda_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct test0 {
};

// CHECK-LABEL: func.func @__nvqpp__mlirgen__test0
// CHECK: %[[VAL_2:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_3:.*]] = cc.create_lambda {
// CHECK: } : !cc.lambda<(!quake.ref) -> ()>
// CHECK: %[[VAL_12:.*]] = quake.extract_ref %[[VAL_2]][%{{.*}}] : (!quake.veq<?>, i64) -> !quake.ref
Expand All @@ -46,15 +46,13 @@ struct test1 {
};

// CHECK-LABEL: func.func @__nvqpp__mlirgen__test1
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel"} {
// CHECK: %[[VAL_3:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<2>
// CHECK: %[[VAL_3:.*]] = quake.alloca !quake.veq<2>
// CHECK: %[[VAL_4:.*]] = cc.create_lambda {
// CHECK: } : !cc.lambda<(!quake.ref) -> ()>
// CHECK: %[[VAL_13:.*]] = quake.extract_ref %[[VAL_3]][%{{.*}}] : (!quake.veq<2>, i64) -> !quake.ref
// CHECK: %[[VAL_16:.*]] = quake.extract_ref %[[VAL_3]][%{{.*}}] : (!quake.veq<2>, i64) -> !quake.ref
// CHECK: quake.apply @__nvqpp__mlirgen__{{.*}}5test1{{.*}}[%[[VAL_13]]] %[[VAL_16]] : (!quake.ref, !quake.ref) -> ()
// CHECK: return
// CHECK: }

// CHECK-LABEL: func.func @__nvqpp__mlirgen__
// CHECK-SAME: 5test1
Expand Down Expand Up @@ -84,7 +82,7 @@ struct test2b {
};

// CHECK-LABEL: func.func @__nvqpp__mlirgen__test2b
// CHECK: %[[VAL_2:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_4:.*]] = cc.create_lambda {
// CHECK: } : !cc.lambda<(!quake.ref) -> ()>
// CHECK: call @__nvqpp__mlirgen__instance_test2a{{.*}}(%{{.*}}, %[[VAL_2]]) : (!cc.lambda<(!quake.ref) -> ()>, !quake.veq<?>) -> ()
Expand Down Expand Up @@ -130,7 +128,7 @@ struct test2c {
};

// CHECK-LABEL: func.func @__nvqpp__mlirgen__test2c
// CHECK: %[[VAL_2:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_3:.*]] = cc.create_lambda {
// CHECK: } : !cc.lambda<(!quake.ref) -> ()>
// CHECK: call @__nvqpp__mlirgen__instance_test2a_c{{.*}}(%{{.*}}, %[[VAL_2]]) : (!cc.lambda<(!quake.ref) -> ()>, !quake.veq<?>) -> ()
Expand Down Expand Up @@ -193,7 +191,7 @@ struct test3 {
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel"} {
// CHECK: %[[VAL_0:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_1:.*]] = arith.extsi %[[VAL_0]] : i32 to i64
// CHECK: %[[VAL_2:.*]] = quake.alloca[%[[VAL_1]] : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%[[VAL_1]] : i64]
// CHECK: %[[VAL_3:.*]] = cc.create_lambda {
// CHECK: ^bb0(%[[VAL_4:.*]]: !quake.ref):
// CHECK: cc.scope {
Expand Down
4 changes: 2 additions & 2 deletions test/AST-Quake/lambda_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct test3_caller {

// CHECK-LABEL: func.func @__nvqpp__mlirgen__test3_caller
// CHECK-SAME: () attributes {
// CHECK: %[[VAL_2:.*]] = quake.alloca[%{{.*}} : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%{{.*}} : i64]
// CHECK: %[[VAL_4:.*]] = cc.create_lambda {
// CHECK: ^bb0(%[[VAL_5:.*]]: !quake.ref):
// CHECK: cc.scope {
Expand Down Expand Up @@ -84,7 +84,7 @@ struct test4_caller {
// CHECK-SAME: () attributes {"cudaq-entrypoint", "cudaq-kernel"} {
// CHECK: %[[VAL_0:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_1:.*]] = arith.extsi %[[VAL_0]] : i32 to i64
// CHECK: %[[VAL_2:.*]] = quake.alloca[%[[VAL_1]] : i64] !quake.veq<?>
// CHECK: %[[VAL_2:.*]] = quake.alloca !quake.veq<?>[%[[VAL_1]] : i64]
// CHECK: %[[VAL_3:.*]] = cc.undef !llvm.struct<"test4_callee", ()>
// CHECK: %[[VAL_4:.*]] = cc.create_lambda {
// CHECK: ^bb0(%[[VAL_5:.*]]: !quake.ref):
Expand Down
6 changes: 3 additions & 3 deletions test/AST-Quake/measure_bell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main() { bell{}(100); }
// CHECK: memref.store %[[VAL_0]], %[[VAL_1]][] : memref<i32>
// CHECK: %[[VAL_2:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_3:.*]] = arith.extsi %[[VAL_2]] : i32 to i64
// CHECK: %[[VAL_4:.*]] = quake.alloca[%[[VAL_3]] : i64] !quake.veq<?>
// CHECK: %[[VAL_4:.*]] = quake.alloca !quake.veq<?>[%[[VAL_3]] : i64]
// CHECK: %[[VAL_5:.*]] = arith.constant 0 : i32
// CHECK: %[[VAL_6:.*]] = memref.alloca() : memref<i32>
// CHECK: memref.store %[[VAL_5]], %[[VAL_6]][] : memref<i32>
Expand Down Expand Up @@ -135,7 +135,7 @@ struct tinkerbell {
// CHECK: memref.store %[[VAL_0]], %[[VAL_1]][] : memref<i32>
// CHECK: %[[VAL_2:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_3:.*]] = arith.extsi %[[VAL_2]] : i32 to i64
// CHECK: %[[VAL_4:.*]] = quake.alloca[%[[VAL_3]] : i64] !quake.veq<?>
// CHECK: %[[VAL_4:.*]] = quake.alloca !quake.veq<?>[%[[VAL_3]] : i64]
// CHECK: %[[VAL_5:.*]] = arith.constant 0 : i32
// CHECK: %[[VAL_6:.*]] = memref.alloca() : memref<i32>
// CHECK: memref.store %[[VAL_5]], %[[VAL_6]][] : memref<i32>
Expand Down Expand Up @@ -199,7 +199,7 @@ struct tinkerbell {
// CHECK: memref.store %[[VAL_0]], %[[VAL_1]][] : memref<i32>
// CHECK: %[[VAL_2:.*]] = arith.constant 2 : i32
// CHECK: %[[VAL_3:.*]] = arith.extsi %[[VAL_2]] : i32 to i64
// CHECK: %[[VAL_4:.*]] = quake.alloca[%[[VAL_3]] : i64] !quake.veq<?>
// CHECK: %[[VAL_4:.*]] = quake.alloca !quake.veq<?>[%[[VAL_3]] : i64]
// CHECK: %[[VAL_5:.*]] = arith.constant 0 : i32
// CHECK: %[[VAL_6:.*]] = memref.alloca() : memref<i32>
// CHECK: memref.store %[[VAL_5]], %[[VAL_6]][] : memref<i32>
Expand Down
Loading

0 comments on commit 69472c9

Please sign in to comment.