-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Labels
JitUntriagedCLR JIT issues needing additional triageCLR JIT issues needing additional triagearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbughard-problemmemory modelissues associated with memory modelissues associated with memory model
Milestone
Description
Morph issue:
static volatile int x;
[MethodImpl(MethodImplOptions.NoInlining)]
static int Test(int a) => x & 0;generates
G_M55886_IG01:
G_M55886_IG02:
33C0 xor eax, eax
G_M55886_IG03:
C3 retSimilar issue but involving VN/assertion propagation:
static int Test(int a)
{
int k = a > 42 ? 0 : 0;
return x & k;
}generates the same code as above.
In this case VN assigned x & k the VN of constant 0 and then assertion propagation drops the x load because it only considers persistent side effects.
Found while working on dotnet/coreclr#18257. Initially I thought that we can simple make assertion propagation use GTF_ALL_EFFECT only to discover that it doesn't work because gtNodeHasSideEffects doesn't pay attention to side effects other than GTF_SIDE_EFFECT. So who's paying attention to GTF_ORDER_SIDEEFF and GTF_GLOB_REF?!
category:correctness
theme:volatile
skill-level:expert
cost:large
omariom
Metadata
Metadata
Assignees
Labels
JitUntriagedCLR JIT issues needing additional triageCLR JIT issues needing additional triagearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbughard-problemmemory modelissues associated with memory modelissues associated with memory model