-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Constant propagation should preserve field sequences #64876
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsThis is a CQ-only issue. We can see cases where (local) constant propagation propagates known addresses of statics and loses field sequences for them. This causes VN to be more pessimistic about those addresses than is necessary. Fixing this would require saving the field sequence alongside the constant itself in assertions. Unfortunately, currently there is no space available, so some refactoring would be required to make sure there would be no memory consumption regression from this change.
|
struct AssertionDsc
{
optAssertionKind assertionKind;
struct SsaVar
{
unsigned lclNum; // assigned to or property of this local var number
unsigned ssaNum;
};
struct ArrBnd
{
ValueNum vnIdx;
ValueNum vnLen;
};
struct AssertionDscOp1
{
optOp1Kind kind; // a normal LclVar, or Exact-type or Subtype
ValueNum vn;
union {
SsaVar lcl;
ArrBnd bnd;
};
} op1;
struct AssertionDscOp2
{
optOp2Kind kind; // a const or copy assignment
ValueNum vn;
struct IntVal
{
ssize_t iconVal; // integer
#if !defined(HOST_64BIT)
unsigned padding; // unused; ensures iconFlags does not overlap lconVal
#endif
GenTreeFlags iconFlags; // gtFlags
};
union {
SsaVar lcl;
IntVal u1;
__int64 lconVal;
double dconVal;
IntegralRange u2;
};
} op2; Memory layout:
Obvious things:
|
This is a CQ-only issue. We can see cases where (local) constant propagation propagates known addresses of statics and loses field sequences for them. This causes VN to be more pessimistic about those addresses than is necessary.
Fixing this would require saving the field sequence alongside the constant itself in assertions. Unfortunately, currently there is no space available, so some refactoring would be required to make sure there would be no memory consumption regression from this change.
The text was updated successfully, but these errors were encountered: