-
Notifications
You must be signed in to change notification settings - Fork 47
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
base: main
Are you sure you want to change the base?
Conversation
@@ -619,11 +619,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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, no one is using this? 😅
Hello. You may have forgotten to update the changelog!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Erick for PR. 🥳 I left some comments here
I feel that dev_name
may seem a little unclear, but using the full term, such as device_name
might make it more straightforward. I'm not sure whether that name includes any reserved keywords.
But no worries! If you like dev_name
, it's absolutely fine to stick with that! 😅
@@ -85,12 +85,12 @@ def DeviceInitOp : Quantum_Op<"device"> { | |||
let arguments = (ins | |||
Optional<I64>:$shots, | |||
StrAttr:$lib, | |||
StrAttr:$name, | |||
StrAttr:$dev_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StrAttr:$dev_name, | |
StrAttr:$device_name, |
StrAttr:$kwargs | ||
); | ||
|
||
let assemblyFormat = [{ | ||
(`shots` `(` $shots^ `)`)? `[` $lib `,` $name `,` $kwargs `]` attr-dict | ||
(`shots` `(` $shots^ `)`)? `[` $lib `,` $dev_name `,` $kwargs `]` attr-dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(`shots` `(` $shots^ `)`)? `[` $lib `,` $dev_name `,` $kwargs `]` attr-dict | |
(`shots` `(` $shots^ `)`)? `[` $lib `,` $device_name `,` $kwargs `]` attr-dict |
@@ -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.getDevNameAttr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringAttr name = deviceInitOp.getDevNameAttr(); | |
StringAttr name = deviceInitOp.getDeviceNameAttr(); |
@@ -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.getDevName().str(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto rtd_name = op.getDevName().str(); | |
auto rtd_name = op.getDeviceName().str(); |
Context:
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: