Skip to content

Commit

Permalink
Rename subvec to subveq (#503)
Browse files Browse the repository at this point in the history
Description
Initial PR for #472. A follow-up PR will implement constant folding.

* refactor out subvec to subveq

Signed-off-by: A.M. Santana <[email protected]>

* missed one

Signed-off-by: A.M. Santana <[email protected]>

---------

Signed-off-by: A.M. Santana <[email protected]>
  • Loading branch information
anthony-santana authored Jul 27, 2023
1 parent 5944bb5 commit 2e625a1
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 71 deletions.
16 changes: 8 additions & 8 deletions include/cudaq/Optimizer/Dialect/Quake/Canonical.td
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def FuseConstantToExtractRefPattern : Pat<
(createExtractRefOp $veq, $index),
[(SizeIsPresentPred $index)]>;

def createSizedSubVecOp : NativeCodeCall<
"quake::createSizedSubVecOp($_builder, $_loc, $0, $1, $2, $3)">;
def createSizedSubVeqOp : NativeCodeCall<
"quake::createSizedSubVeqOp($_builder, $_loc, $0, $1, $2, $3)">;

def ArgIsConstantPred : Constraint<CPred<
"dyn_cast_or_null<mlir::arith::ConstantOp>($0.getDefiningOp())">>;
Expand All @@ -75,17 +75,17 @@ def IsUnknownVec : Constraint<CPred<

// %1 = constant 4 : i64
// %2 = constant 10 : i64
// %3 = quake.subvec (%0 : !quake.ref<12>, %1 : i64, %2 : i64) : !quake.ref<?>
// %3 = quake.subveq (%0 : !quake.ref<12>, %1 : i64, %2 : i64) : !quake.ref<?>
// ─────────────────────────────────────────────────────────────────────────────
// %1 = constant 4 : i64
// %2 = constant 10 : i64
// %new3 = quake.subvec (%0 : !quake.ref<12>, %1 : i64, %2 : i64) :
// %new3 = quake.subveq (%0 : !quake.ref<12>, %1 : i64, %2 : i64) :
// !quake.ref<7>
// %3 = quake.relax_size %new3 : (!quake.ref<7>) -> !quake.ref<?>
def FuseConstantToSubvecPattern : Pat<
(quake_SubVecOp:$subvec $v, $lo, $hi),
(createSizedSubVecOp $subvec, $v, $lo, $hi),
[(UnknownSizePred $subvec), (ArgIsConstantPred $lo),
def FuseConstantToSubveqPattern : Pat<
(quake_SubVeqOp:$subveq $v, $lo, $hi),
(createSizedSubVeqOp $subveq, $v, $lo, $hi),
[(UnknownSizePred $subveq), (ArgIsConstantPred $lo),
(ArgIsConstantPred $hi)]>;

#endif
2 changes: 1 addition & 1 deletion include/cudaq/Optimizer/Dialect/Quake/QuakeOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mlir::Value createConstantAlloca(mlir::PatternRewriter &builder,
mlir::Location loc, mlir::OpResult result,
mlir::ValueRange args);

mlir::Value createSizedSubVecOp(mlir::PatternRewriter &builder,
mlir::Value createSizedSubVeqOp(mlir::PatternRewriter &builder,
mlir::Location loc, mlir::OpResult result,
mlir::Value inVec, mlir::Value lo,
mlir::Value hi);
Expand Down
6 changes: 3 additions & 3 deletions include/cudaq/Optimizer/Dialect/Quake/QuakeOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ def quake_RelaxSizeOp : QuakeOp<"relax_size", [Pure]> {
let hasCanonicalizer = 1;
}

def quake_SubVecOp : QuakeOp<"subvec", [Pure]> {
def quake_SubVeqOp : QuakeOp<"subveq", [Pure]> {
let summary = "Extract a subvector from a veq reference value.";
let description = [{
The `subvec` operation returns a subvector of references, type
The `subveq` operation returns a subvector of references, type
`!quake.veq<N>` from a vector of references, type `!quake.veq<M>`, where
`M >= N`.

Expand All @@ -310,7 +310,7 @@ def quake_SubVecOp : QuakeOp<"subvec", [Pure]> {
```mlir
%0 = arith.constant 2 : i32
%1 = arith.constant 6 : i32
%qr = quake.subvec %qv, %0, %1 : (!quake.veq<?>, i32, i32) ->
%qr = quake.subveq %qv, %0, %1 : (!quake.veq<?>, i32, i32) ->
!quake.veq<5>
```
}];
Expand Down
12 changes: 6 additions & 6 deletions lib/Frontend/nvqpp/ConvertExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ maybeUnpackOperands(OpBuilder &builder, Location loc, ValueRange operands) {
// The canonicalizer will compute a constant size, if possible.
auto unsizedVeqTy = quake::VeqType::getUnsized(builder.getContext());
// Get the subvector of all qubits excluding the last one: controls.
Value ctrlSubvec =
builder.create<quake::SubVecOp>(loc, unsizedVeqTy, target, zero, last);
Value ctrlSubveq =
builder.create<quake::SubVeqOp>(loc, unsizedVeqTy, target, zero, last);
return std::make_pair(SmallVector<Value>{qTarg},
SmallVector<Value>{ctrlSubvec});
SmallVector<Value>{ctrlSubveq});
}
return std::make_pair(SmallVector<Value>{target}, SmallVector<Value>{});
}
Expand Down Expand Up @@ -1173,7 +1173,7 @@ bool QuakeBridgeVisitor::VisitCallExpr(clang::CallExpr *x) {
auto offset = builder.create<arith::SubIOp>(loc, qrSize, one);
auto unsizedVecTy =
quake::VeqType::getUnsized(builder.getContext());
return pushValue(builder.create<quake::SubVecOp>(
return pushValue(builder.create<quake::SubVeqOp>(
loc, unsizedVecTy, qregArg, zero, offset));
}
assert(actArgs.size() == 0);
Expand All @@ -1195,7 +1195,7 @@ bool QuakeBridgeVisitor::VisitCallExpr(clang::CallExpr *x) {
builder.create<arith::SubIOp>(loc, qrSize, actArgs.front());
auto unsizedVecTy =
quake::VeqType::getUnsized(builder.getContext());
return pushValue(builder.create<quake::SubVecOp>(
return pushValue(builder.create<quake::SubVeqOp>(
loc, unsizedVecTy, qregArg, startOff, endOff));
}
assert(actArgs.size() == 0);
Expand All @@ -1215,7 +1215,7 @@ bool QuakeBridgeVisitor::VisitCallExpr(clang::CallExpr *x) {
Value offset = builder.create<arith::AddIOp>(loc, start, count);
offset = builder.create<arith::SubIOp>(loc, offset, one);
auto unsizedVecTy = quake::VeqType::getUnsized(builder.getContext());
return pushValue(builder.create<quake::SubVecOp>(
return pushValue(builder.create<quake::SubVeqOp>(
loc, unsizedVecTy, qregArg, start, offset));
}
}
Expand Down
16 changes: 8 additions & 8 deletions lib/Optimizer/CodeGen/LowerToQIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,24 +273,24 @@ class ExtractQubitOpRewrite
}
};

class SubvecOpRewrite : public ConvertOpToLLVMPattern<quake::SubVecOp> {
class SubveqOpRewrite : public ConvertOpToLLVMPattern<quake::SubVeqOp> {
public:
using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern;

LogicalResult
matchAndRewrite(quake::SubVecOp subvec, OpAdaptor adaptor,
matchAndRewrite(quake::SubVeqOp subveq, OpAdaptor adaptor,
ConversionPatternRewriter &rewriter) const override {
auto loc = subvec->getLoc();
auto parentModule = subvec->getParentOfType<ModuleOp>();
auto loc = subveq->getLoc();
auto parentModule = subveq->getParentOfType<ModuleOp>();
auto *context = parentModule->getContext();
constexpr auto rtSubvecFuncName = cudaq::opt::QIRArraySlice;
constexpr auto rtSubveqFuncName = cudaq::opt::QIRArraySlice;
auto arrayTy = cudaq::opt::getArrayType(context);
auto resultTy = arrayTy;

auto i32Ty = rewriter.getIntegerType(32);
auto i64Ty = rewriter.getIntegerType(64);
FlatSymbolRefAttr symbolRef = cudaq::opt::factory::createLLVMFunctionSymbol(
rtSubvecFuncName, arrayTy, {arrayTy, i32Ty, i64Ty, i64Ty, i64Ty},
rtSubveqFuncName, arrayTy, {arrayTy, i32Ty, i64Ty, i64Ty, i64Ty},
parentModule);

Value lowArg = adaptor.getOperands()[1];
Expand All @@ -309,7 +309,7 @@ class SubvecOpRewrite : public ConvertOpToLLVMPattern<quake::SubVecOp> {
auto one32 = rewriter.create<arith::ConstantIntOp>(loc, 1, i32Ty);
auto one64 = rewriter.create<arith::ConstantIntOp>(loc, 1, i64Ty);
rewriter.replaceOpWithNewOp<LLVM::CallOp>(
subvec, resultTy, symbolRef,
subveq, resultTy, symbolRef,
ValueRange{inArr, one32, lowArg, one64, highArg});
return success();
}
Expand Down Expand Up @@ -1335,7 +1335,7 @@ class QuakeToQIRRewrite : public cudaq::opt::QuakeToQIRBase<QuakeToQIRRewrite> {
OneTargetTwoParamRewrite<quake::U2Op>,
OneTargetTwoParamRewrite<quake::U3Op>, ResetRewrite<quake::ResetOp>,
StdvecDataOpPattern, StdvecInitOpPattern, StdvecSizeOpPattern,
StoreOpPattern, SubvecOpRewrite, TwoTargetRewrite<quake::SwapOp>,
StoreOpPattern, SubveqOpRewrite, TwoTargetRewrite<quake::SwapOp>,
UndefOpPattern>(typeConverter);

target.addLegalDialect<LLVM::LLVMDialect>();
Expand Down
12 changes: 6 additions & 6 deletions lib/Optimizer/Dialect/Quake/QuakeOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ void quake::RelaxSizeOp::getCanonicalizationPatterns(
}

//===----------------------------------------------------------------------===//
// SubVecOp
// SubVeqOp
//===----------------------------------------------------------------------===//

Value quake::createSizedSubVecOp(PatternRewriter &builder, Location loc,
Value quake::createSizedSubVeqOp(PatternRewriter &builder, Location loc,
OpResult result, Value inVec, Value lo,
Value hi) {
auto vecTy = result.getType().cast<quake::VeqType>();
Expand All @@ -267,13 +267,13 @@ Value quake::createSizedSubVecOp(PatternRewriter &builder, Location loc,
};
std::size_t size = getVal(hi) - getVal(lo) + 1u;
auto szVecTy = quake::VeqType::get(ctx, size);
auto subvec = builder.create<quake::SubVecOp>(loc, szVecTy, inVec, lo, hi);
return builder.create<quake::RelaxSizeOp>(loc, vecTy, subvec);
auto subveq = builder.create<quake::SubVeqOp>(loc, szVecTy, inVec, lo, hi);
return builder.create<quake::RelaxSizeOp>(loc, vecTy, subveq);
}

void quake::SubVecOp::getCanonicalizationPatterns(RewritePatternSet &patterns,
void quake::SubVeqOp::getCanonicalizationPatterns(RewritePatternSet &patterns,
MLIRContext *context) {
patterns.add<FuseConstantToSubvecPattern>(context);
patterns.add<FuseConstantToSubveqPattern>(context);
}

//===----------------------------------------------------------------------===//
Expand Down
40 changes: 20 additions & 20 deletions lib/Optimizer/Transforms/CombineQuantumAlloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class AllocaPat : public OpRewritePattern<quake::AllocaOp> {
alloc.getLoc(), os.first, rewriter.getI64Type());
Value hi = rewriter.create<arith::ConstantIntOp>(
alloc.getLoc(), os.first + os.second - 1, rewriter.getI64Type());
[[maybe_unused]] Value subvec =
rewriter.replaceOpWithNewOp<quake::SubVecOp>(
[[maybe_unused]] Value subveq =
rewriter.replaceOpWithNewOp<quake::SubVeqOp>(
alloc, alloc.getType(), analysis.newAlloc, lo, hi);
LLVM_DEBUG(llvm::dbgs()
<< "replace " << alloc << " with " << subvec << '\n');
<< "replace " << alloc << " with " << subveq << '\n');
return success();
}
}
Expand All @@ -91,7 +91,7 @@ class ExtractPat : public OpRewritePattern<quake::ExtractRefOp> {
// Replace a pattern such as:
// ```
// %1 = ... : !quake.veq<4>
// %2 = quake.subvec %1, %c2, %c3 : (!quake.veq<4>, i32, i32) ->
// %2 = quake.subveq %1, %c2, %c3 : (!quake.veq<4>, i32, i32) ->
// !quake.veq<2>
// %3 = quake.extract_ref %2[0] : (!quake.veq<2>) -> !quake.ref
// ```
Expand All @@ -102,13 +102,13 @@ class ExtractPat : public OpRewritePattern<quake::ExtractRefOp> {
// ```
LogicalResult matchAndRewrite(quake::ExtractRefOp extract,
PatternRewriter &rewriter) const override {
auto subvec = extract.getVeq().getDefiningOp<quake::SubVecOp>();
if (!subvec || isa<quake::SubVecOp>(subvec.getVeq().getDefiningOp()))
auto subveq = extract.getVeq().getDefiningOp<quake::SubVeqOp>();
if (!subveq || isa<quake::SubVeqOp>(subveq.getVeq().getDefiningOp()))
return failure();

Value offset;
auto loc = extract.getLoc();
Value low = subvec.getLow();
Value low = subveq.getLow();
if (extract.hasConstantIndex()) {
Value cv = rewriter.create<arith::ConstantIntOp>(
loc, extract.getConstantIndex(), low.getType());
Expand All @@ -118,30 +118,30 @@ class ExtractPat : public OpRewritePattern<quake::ExtractRefOp> {
Value cast2 = createCast(rewriter, loc, low);
offset = rewriter.create<arith::AddIOp>(loc, cast1, cast2);
}
rewriter.replaceOpWithNewOp<quake::ExtractRefOp>(extract, subvec.getVeq(),
rewriter.replaceOpWithNewOp<quake::ExtractRefOp>(extract, subveq.getVeq(),
offset);
return success();
}
};

class SubVecPat : public OpRewritePattern<quake::SubVecOp> {
class SubVeqPat : public OpRewritePattern<quake::SubVeqOp> {
public:
using OpRewritePattern::OpRewritePattern;

LogicalResult matchAndRewrite(quake::SubVecOp subvec,
LogicalResult matchAndRewrite(quake::SubVeqOp subveq,
PatternRewriter &rewriter) const override {
auto prior = subvec.getVeq().getDefiningOp<quake::SubVecOp>();
auto prior = subveq.getVeq().getDefiningOp<quake::SubVeqOp>();
if (!prior)
return failure();

auto loc = subvec.getLoc();
auto loc = subveq.getLoc();
Value cast1 = createCast(rewriter, loc, prior.getLow());
Value cast2 = createCast(rewriter, loc, subvec.getLow());
Value cast3 = createCast(rewriter, loc, subvec.getHigh());
Value cast2 = createCast(rewriter, loc, subveq.getLow());
Value cast3 = createCast(rewriter, loc, subveq.getHigh());
Value sum1 = rewriter.create<arith::AddIOp>(loc, cast1, cast2);
Value sum2 = rewriter.create<arith::AddIOp>(loc, cast1, cast3);
auto veqTy = subvec.getType();
rewriter.replaceOpWithNewOp<quake::SubVecOp>(subvec, veqTy, prior.getVeq(),
auto veqTy = subveq.getType();
rewriter.replaceOpWithNewOp<quake::SubVeqOp>(subveq, veqTy, prior.getVeq(),
sum1, sum2);
return success();
}
Expand Down Expand Up @@ -189,16 +189,16 @@ class CombineQuantumAllocationsPass
analysis.newAlloc = rewriter.create<quake::AllocaOp>(loc, veqTy);

// 3. Greedily replace the uses of the original alloca ops with uses of
// partitions of the new alloca op. Replace subvec of subvec with a single
// new subvec. Replace extract from subvec with extract from original
// partitions of the new alloca op. Replace subveq of subveq with a single
// new subveq. Replace extract from subveq with extract from original
// veq.
{
RewritePatternSet patterns(ctx);
patterns.insert<AllocaPat>(ctx, analysis);
patterns.insert<ExtractPat, SubVecPat>(ctx);
patterns.insert<ExtractPat, SubVeqPat>(ctx);
if (failed(applyPatternsAndFoldGreedily(func.getOperation(),
std::move(patterns)))) {
func.emitOpError("combining alloca, subvec, and extract ops failed");
func.emitOpError("combining alloca, subveq, and extract ops failed");
signalPassFailure();
}
}
Expand Down
8 changes: 4 additions & 4 deletions runtime/cudaq/builder/QuakeValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ QuakeValue QuakeValue::slice(const std::size_t startIdx,
Value offset = opBuilder.create<arith::AddIOp>(startIdxValue, countValue);
offset = opBuilder.create<arith::SubIOp>(offset, one);
auto sizedVecTy = quake::VeqType::get(opBuilder.getContext(), count);
Value subVec = opBuilder.create<quake::SubVecOp>(sizedVecTy, vectorValue,
Value subVeq = opBuilder.create<quake::SubVeqOp>(sizedVecTy, vectorValue,
startIdxValue, offset);
return QuakeValue(opBuilder, subVec);
return QuakeValue(opBuilder, subVeq);
}

// must be a stdvec type
Expand Down Expand Up @@ -262,7 +262,7 @@ QuakeValue QuakeValue::slice(const std::size_t startIdx,
}
auto ptr = opBuilder.create<cc::ComputePtrOp>(
ptrTy, vecPtr, ArrayRef<cc::ComputePtrArg>{offset});
Value subVecInit = opBuilder.create<cc::StdvecInitOp>(vectorValue.getType(),
Value subVeqInit = opBuilder.create<cc::StdvecInitOp>(vectorValue.getType(),
ptr, countValue);

// If this is a slice, then we know we have
Expand All @@ -271,7 +271,7 @@ QuakeValue QuakeValue::slice(const std::size_t startIdx,
for (std::size_t i = startIdx; i < startIdx + count; i++)
value->addUniqueExtraction(i);

return QuakeValue(opBuilder, subVecInit);
return QuakeValue(opBuilder, subVeqInit);
}

mlir::Value QuakeValue::getValue() const { return value->asMLIR(); }
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 @@ -102,7 +102,7 @@ struct run_circuit {
// ADJOINT: %[[VAL_10:.*]] = arith.subi %[[VAL_9]], %[[VAL_7]] : i32
// ADJOINT: %[[VAL_11:.*]] = arith.extsi %[[VAL_10]] : i32 to i64
// ADJOINT: %[[VAL_12:.*]] = arith.subi %[[VAL_11]], %[[VAL_5]] : i64
// ADJOINT: %[[VAL_13:.*]] = quake.subvec %[[VAL_0]], %[[VAL_6]], %[[VAL_12]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// ADJOINT: %[[VAL_13:.*]] = quake.subveq %[[VAL_0]], %[[VAL_6]], %[[VAL_12]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// ADJOINT: %[[VAL_14:.*]] = quake.vec_size %[[VAL_13]] : (!quake.veq<?>) -> i64
// ADJOINT: %[[VAL_15:.*]] = arith.index_cast %[[VAL_14]] : i64 to index
// ADJOINT: %[[VAL_16:.*]] = arith.subi %[[VAL_9]], %[[VAL_7]] : i32
Expand Down
4 changes: 2 additions & 2 deletions test/AST-Quake/qpe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ int main() {
// CHECK: %[[VAL_13:.*]] = arith.constant 0 : i64
// CHECK: %[[VAL_14:.*]] = arith.constant 1 : i64
// CHECK: %[[VAL_15:.*]] = arith.subi %[[VAL_12]], %[[VAL_14]] : i64
// CHECK: %[[VAL_16:.*]] = quake.subvec %[[VAL_10]], %[[VAL_13]], %[[VAL_15]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// CHECK: %[[VAL_16:.*]] = quake.subveq %[[VAL_10]], %[[VAL_13]], %[[VAL_15]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// CHECK: %[[VAL_17:.*]] = cc.load %[[VAL_5]] : !cc.ptr<i32>
// CHECK: %[[VAL_18:.*]] = arith.extsi %[[VAL_17]] : i32 to i64
// CHECK: %[[VAL_19:.*]] = quake.vec_size %[[VAL_10]] : (!quake.veq<?>) -> i64
// CHECK: %[[VAL_20:.*]] = arith.constant 1 : i64
// CHECK: %[[VAL_21:.*]] = arith.subi %[[VAL_19]], %[[VAL_20]] : i64
// CHECK: %[[VAL_22:.*]] = arith.subi %[[VAL_19]], %[[VAL_18]] : i64
// CHECK: %[[VAL_23:.*]] = quake.subvec %[[VAL_10]], %[[VAL_22]], %[[VAL_21]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// CHECK: %[[VAL_23:.*]] = quake.subveq %[[VAL_10]], %[[VAL_22]], %[[VAL_21]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// CHECK: call @__nvqpp__mlirgen__Z4mainE3$_0(%[[VAL_23]]) : (!quake.veq<?>) -> ()
// CHECK: %[[VAL_24:.*]] = quake.vec_size %[[VAL_16]] : (!quake.veq<?>) -> i64
// CHECK: %[[VAL_25:.*]] = arith.index_cast %[[VAL_24]] : i64 to index
Expand Down
2 changes: 1 addition & 1 deletion test/AST-Quake/slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct SliceTest {
// CHECK: %[[VAL_11:.*]] = arith.constant 1 : i64
// CHECK: %[[VAL_12:.*]] = arith.addi %{{.*}}, %{{.*}} : i64
// CHECK: %[[VAL_13:.*]] = arith.subi %[[VAL_12]], %[[VAL_11]] : i64
// CHECK: %[[VAL_14:.*]] = quake.subvec %[[VAL_6]], %{{.*}}, %[[VAL_13]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// CHECK: %[[VAL_14:.*]] = quake.subveq %[[VAL_6]], %{{.*}}, %[[VAL_13]] : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
// CHECK: call @{{.*}}other{{.*}}(%[[VAL_14]]) : (!quake.veq<?>) -> ()
// CHECK: return
// CHECK: }
4 changes: 2 additions & 2 deletions test/Quake/canonical-1.qke
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func.func @test3() {
%2 = arith.constant 4 : i64
%3 = arith.constant 7 : i64
// This subvec veq<?> can be reified to veq<4>
%4 = quake.subvec %1, %2, %3 : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
%4 = quake.subveq %1, %2, %3 : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
%5 = arith.constant 2 : i64
%6 = quake.extract_ref %4[%5] : (!quake.veq<?>,i64) -> !quake.ref
quake.h %6 : (!quake.ref) -> ()
Expand All @@ -50,7 +50,7 @@ func.func @test3() {
// CHECK: %[[VAL_1:.*]] = arith.constant 7 : i64
// CHECK: %[[VAL_2:.*]] = arith.constant 4 : i64
// CHECK: %[[VAL_3:.*]] = quake.alloca !quake.veq<10>
// CHECK: %[[VAL_4:.*]] = quake.subvec %[[VAL_3]], %[[VAL_2]], %[[VAL_1]] : (!quake.veq<10>, i64, i64) -> !quake.veq<4>
// CHECK: %[[VAL_4:.*]] = quake.subveq %[[VAL_3]], %[[VAL_2]], %[[VAL_1]] : (!quake.veq<10>, i64, i64) -> !quake.veq<4>
// CHECK: %[[VAL_5:.*]] = quake.extract_ref %[[VAL_4]][2] : (!quake.veq<4>) -> !quake.ref
// CHECK: quake.h %[[VAL_5]] : (!quake.ref) -> ()
// CHECK: return
Expand Down
2 changes: 1 addition & 1 deletion test/Quake/canonical-2.qke
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
%c0_i64 = arith.constant 0 : i64
%c1_i64 = arith.constant 1 : i64
%3 = arith.subi %2, %c1_i64 : i64
%4 = quake.subvec %arg0, %c0_i64, %3 : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
%4 = quake.subveq %arg0, %c0_i64, %3 : (!quake.veq<?>, i64, i64) -> !quake.veq<?>
%5 = quake.vec_size %arg0 : (!quake.veq<?>) -> i64
%c1_i64_0 = arith.constant 1 : i64
%6 = arith.subi %5, %c1_i64_0 : i64
Expand Down
Loading

0 comments on commit 2e625a1

Please sign in to comment.