-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle complex local addresses in block morphing
In block morphing, "addrSpill" is used when the destination or source represent indirections of "complex" addresses. Unfortunately, some trees in the form of "IND(ADDR(LCL))" fall into this category. If such an "ADDR(LCL)" is used as an "addrSpill", the underlying local *must* be marked as address-exposed. Block morphing was using a very simplistic test for when that needs to happen, essentially only recognizing "ADDR(LCL_VAR/FLD)". But it is possible to have a more complicated pattern as "PrepareDst/Src" uses "IsLocalAddrExpr" to recognize indirect stores to locals. Currently it appears impossible to get a mismatch here as morph transforms "IND(ADD(ADDR(LCL_VAR), OFFSET))" into "LCL_FLD" (including for TYP_STRUCT indirections), but this is a very fragile invariant. Transforming TYP_STRUCT GT_FIELDs into GT_OBJs instead of GT_INDs breaks it, for example. Fix this by address-exposing the local obtained via "IsLocalAddrExpr".
- Loading branch information
1 parent
64c05a3
commit 51fd539
Showing
1 changed file
with
11 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters