Uh oh!
There was an error while loading. Please reload this page.
Fix incorrect VN when folding GT_NEG(GT_MUL(A, C)) - #57651
Conversation
ghost
commented
Aug 18, 2021
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFixes #57640 cc @dotnet/jit-contrib @SingleAccretion
|
EgorBo
commented
Aug 18, 2021
I guess it has to be back ported to 6.0 branch |
jakobbotsch
commented
Aug 18, 2021
Yep, I'll do it once this makes it through CI |
| @@ -13177,6 +13177,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) | |||
| GenTree* newOp2 = gtNewIconNode(-constVal, op1op2->TypeGet()); // -C | |||
There was a problem hiding this comment.
I think we also want to update the VN for the new constant (this is what we do in other places). But since we haven't actually found a bug with it (yet), and the way to do it is kinda verbose right now, and I will be PRing changes that will make it less verbose soon, and the fact that this PR is likely to be backported, I think it is fine to leave this as is.
There was a problem hiding this comment.
Right, this ends up as a constant without any VN, but my impression was that we handle this ok downstream.
There was a problem hiding this comment.
I similarly haven't seen places in the optimizer that would trip up on a NoVN constant tree. I would not be surprised if they exist though, these contracts on what should and should not be maintained are very implicit.
EgorBo
commented
Aug 18, 2021
@jakobbotsch can you please do the same with https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/morph.cpp#L11175-L11189 or ideally somehow unify it with NEG(MUL(A,C)) opt |
EgorBo
commented
Aug 18, 2021
jakobbotsch
commented
Aug 18, 2021
@EgorBo I don't think those have the problem since they don't return a sub tree. |
EgorBo
commented
Aug 18, 2021
ah, right, nvm, in case of |
jakobbotsch
commented
Aug 18, 2021
CI failures look like #57620 |
jakobbotsch
commented
Aug 18, 2021
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1144500550 |
Fixes#57640
cc @dotnet/jit-contrib @SingleAccretion