Skip to content

Rename of operands/attributes to avoid xDSL reserved keywords #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mlir/include/Quantum/IR/QuantumOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def DeviceInitOp : Quantum_Op<"device"> {
let arguments = (ins
Optional<I64>:$shots,
StrAttr:$lib,
StrAttr:$name,
StrAttr:$device_name,
StrAttr:$kwargs
);

let assemblyFormat = [{
(`shots` `(` $shots^ `)`)? `[` $lib `,` $name `,` $kwargs `]` attr-dict
(`shots` `(` $shots^ `)`)? `[` $lib `,` $device_name `,` $kwargs `]` attr-dict
}];

}
Expand Down Expand Up @@ -663,11 +663,11 @@ def YieldOp : Quantum_Op<"yield", [Pure, ReturnLike, Terminator, ParentOneOf<["A
let summary = "Return results from quantum program regions";

let arguments = (ins
Variadic<QuregType>:$results
Variadic<QuregType>:$retvals
);

let assemblyFormat = [{
attr-dict ($results^ `:` type($results))?
attr-dict ($retvals ^ `:` type($retvals))?
}];

let builders = [
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Mitigation/Transforms/MitigationMethods/Zne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ FlatSymbolRefAttr ZneLowering::getOrInsertFoldedCircuit(Location loc, PatternRew

Operation *shots = deviceInitOp.getShots().getDefiningOp();
StringAttr lib = deviceInitOp.getLibAttr();
StringAttr name = deviceInitOp.getNameAttr();
StringAttr name = deviceInitOp.getDeviceNameAttr();
StringAttr kwargs = deviceInitOp.getKwargsAttr();

TypeRange originalTypes = op.getArgumentTypes();
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Quantum/Transforms/ConversionPatterns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ struct DeviceInitOpPattern : public OpConversionPattern<DeviceInitOp> {
catalyst::ensureFunctionDeclaration(rewriter, op, qirName, qirSignature);

auto rtd_lib = op.getLib().str();
auto rtd_name = op.getName().str();
auto rtd_name = op.getDeviceName().str();
auto rtd_kwargs = op.getKwargs().str();

auto rtd_lib_gs = getGlobalString(loc, rewriter, rtd_lib,
Expand Down