-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Do not fold relocatable constants into displacements #68851
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
Do not fold relocatable constants into displacements #68851
Conversation
The code in "genCreateAddrMode" was performing the equivalent of constant folding ADDs, but failing to take into account the legality of doing that.
|
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsWhen creating address modes, we try to look through cascading N009 ( 9, 11) [000009] ---XG------ * RETURN int
N008 ( 8, 10) [000008] ---XG------ \--* IND ushort
N007 ( 5, 8) [000007] -------N--- \--* ADD byref
N003 ( 3, 6) [000015] ----------- +--* ADD byref
N001 ( 1, 1) [000014] ----------- | +--* CNS_INT long 12 field offset Fseq[_firstChar]
N002 ( 1, 4) [000016] H---------- | \--* CNS_INT(h) ref 0x420068 [ICON_STR_HDL]
N006 ( 2, 2) [000006] -------N--- \--* LSH long
N004 ( 1, 1) [000003] ----------- +--* LCL_VAR long V00 arg0 u:1 (last use)
N005 ( 1, 1) [000005] ----------- \--* CNS_INT long 1We cannot fold such "constants" into Should fix the crashes seen in #68739. No diffs are expected.
|
3bc12e4 to
8a9d859
Compare
jakobbotsch
left a comment
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.
LGTM, the TP impact looks insignificant to me.
|
The Mono AOT failure looks like #57361, presumably exposed by the recently merged #68288: |
When creating address modes, we try to look through cascading
ADDs with constants that could contribute to the final displacement (LEAs "offset"). In doing so, we were failing to take into account the possibility that said constants could be relocatable handles, such as[000016]in the following tree:We cannot fold such "constants" into
LEAs, this change makes the address mode forming logic respect that.Should fix the crashes seen in #68739.
No diffs are expected.