fix: reject intrinsic op variants with immediate when literal argument value exceeds its range#711
fix: reject intrinsic op variants with immediate when literal argument value exceeds its range#711
Conversation
|
|
Checking stubs for changes and corresponding version bump in origin/fix/op-selection Last puyapy release: v5.8.1 ✅ Stub files unchanged |
bc555c9 to
7de9d78
Compare
Argimirodelpozo
left a comment
There was a problem hiding this comment.
So I think that for any op. that would unconditionally fail with something out of bounds for a certain type (gaid, gload, etc.) we should not let that compile but instead emit an error directly. The argument for the different handling vs. what happened with intrinsic folding is that with intrinsic folding it might not be obvious for a dev. that the folding is happening (something might end up foldable after some other opts.) while in this case it'd be a result of direct user input.
Also in this case we wouldn't have the -O0 vs -O1/-O2 divergent behavior, so I'd say lets be aggresive in those instances and fail compilation.
When you say out of bounds here, are you referring to the protocol limit of 16 for number of transactions in a group? If so is that a bound that could ever realistically be changed at the protocol level? |
a7b58ec to
9a4180c
Compare
Yes (the |
9a4180c to
3a619e0
Compare
…ith immediate-arg variant
9a8d6a0 to
b5fd110
Compare
b5fd110 to
7176a92
Compare
Fixes #709.
when building IR from AWST, always pick the stack-arg variant and let the IR optimiser promote stack args to immediates when the values actually fit.
add checks on literal value <= 255 to immediate promotions for
gitxnas,itxnas,loads/storesin IR optimiseradd immediate promotion cases in IR optimiser for
gaids,gloads,gloadss,txnas,gtxns,gtxnas,gtxnsa,gtxnsasso the new AWST behavior still produces the compact form when possible.Note: intrincis simplification optimiser does not run for O0 so O0 stats are up.