Uh oh!
There was an error while loading. Please reload this page.
Track local var ranges for "interfering writes" LIR check - #64804
Conversation
For LIR we verify that we can really consider locals to be used at their user by having a checker that looks for interfering stores to the same locals. However, in some cases we may have "interfering" GT_LCL_FLD/GT_STORE_LCL_FLD, in the sense that they work on the same local but on a disjoint range of bytes. Add support to validate this. This fixesdotnet#57919 which made the fuzzer jobs very noisy and made it easy to miss actual new examples (e.g. dotnet#63720 was just merged even though there were real examples found there). Fixdotnet#57919
ghost
commented
Feb 4, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFor LIR we verify that we can really consider locals to be used at their This fixes #57919 which made the fuzzer jobs very noisy and made it easy Fix #57919
|
jakobbotsch
commented
Feb 4, 2022
/azp run Fuzzlyn |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jakobbotsch
commented
Feb 4, 2022
cc @dotnet/jit-contrib Also @AndyAyersMS there are some presumably forward-sub related failures in the Fuzzlyn run from this PR: https://dev.azure.com/dnceng/public/_build/results?buildId=1591834&view=ms.vss-build-web.run-extensions-tab |
AndyAyersMS
commented
Feb 4, 2022
Thanks, will take a look. |
The x64 windows Forward sub creates Eventually this gets optimized to with the expectation that the FIELD/IND will evaluate before the call, but they get reordered. |
jakobbotsch
commented
Feb 4, 2022
It seems like something that |
AndyAyersMS
commented
Feb 4, 2022
Yeah, xarch's Lowering::ContainCheckCompare is missing a safety check: @@ -4949,7 +4949,7 @@ void Lowering::ContainCheckCompare(GenTreeOp* cmp)
// we can treat the MemoryOp as contained.
if (op1Type == op2Type)
{
- if (IsContainableMemoryOp(op1))+ if (IsContainableMemoryOp(op1) && IsSafeToContainMem(cmp, op1))
{
MakeSrcContained(cmp, op1);
} |
AndyAyersMS
commented
Feb 4, 2022
Let me see if this fixes those other cases too. |
AndyAyersMS
commented
Feb 4, 2022
I can't repro the first x86 issue (seed 5821979800164656837). |
jakobbotsch
commented
Feb 4, 2022
This repros (in both x64 and x86): // Generated by Fuzzlyn v1.5 on 2022-02-04 12:51:20// Run on X86 Windows// Seed: 5821979800164656837// Reduced from 60.0 KiB to 0.3 KiB in 00:01:44// Debug: Outputs 0// Release: Outputs -1publicclassProgram{publicstaticIRTs_rt;publicstaticlongs_4;publicstaticvoidMain(){s_rt=newC();intvr3=(int)(s_4&~M7());s_rt.WriteLine(vr3);}publicstaticshortM7(){reflongvar1=refs_4;var1=9223372036854775807L;return0;}}publicinterfaceIRT{voidWriteLine<T>(Tvalue);}publicclassC:IRT{publicvoidWriteLine<T>(Tvalue){System.Console.WriteLine(value);}} |
AndyAyersMS
commented
Feb 4, 2022
Second x86 issue (9341650659269168733) is fixed by the change to Lowering::ContainCheckCompare. |
AndyAyersMS
commented
Feb 4, 2022
Thanks. This isn't fixed by the change to Lowering::ContainCheckCompare. |
AndyAyersMS
commented
Feb 4, 2022
Think the third x86 issue is also fixed, but still need to verify that it will fail w/o the fix. |
AndyAyersMS
commented
Feb 4, 2022
I can't get 17864721711828342668 to fail with main, at least on x86. |
AndyAyersMS
commented
Feb 4, 2022
Looks like a similar sort of bug, trying to pin down exactly where we are missing a check. Here the parent is Just skimming though lowerxarch, the pattern of first calling |
AndyAyersMS
commented
Feb 4, 2022
I suppose luckily these cases are (were) somewhat rare? No diffs in SPMI from my first bit of fix above. |
For LIR we verify that we can really consider locals to be used at their
user by having a checker that looks for interfering stores to the same
locals. However, in some cases we may have "interfering"
GT_LCL_FLD/GT_STORE_LCL_FLD, in the sense that they work on the same
local but on a disjoint range of bytes. Add support to validate this.
This fixes#57919 which made the fuzzer jobs very noisy and made it easy
to miss actual new examples (e.g. #63720 was just merged even though
there were real examples found there).
Fix#57919