-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
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 SuperPMIdesign-discussionOngoing discussion about design without consensusOngoing discussion about design without consensus
Milestone
Description
This came up occasionally in discussions but AFAIK there's no issue associated with it and IMO there should be due to the significant (negative) impact GT_ASG nodes have on RyuJIT's IR.
IMO it's one of the worst IR "features", if not plain and simple the worst. So far I only encountered pros and no cons:
- It's an extra IR node - wastes memory and slows down IR traversal.
- It imposes a model where the meaning of some nodes depends on the context - a
GT_LCL_VARon the RHS is a use but on the LHS is a def. The JIT uses various means to deal with this issue -GTF_VAR_DEF,GTF_IND_ASG_LHS,gtGetParent()etc. - It complicates UD chain traversal. SSA gives you the
GT_LCL_VARnode on the LHS, from there you need to usegtGetParent()to get theGT_ASGnode and then get the assignment's second operand. If you're lucky the LHS follow the assignment, otherwisegtGetParent()will need to traverse multiple nodes. - It requires additional work to transform HIR into LIR, the later does not use assignment nodes.
- It doesn't match the IL model that uses stores. While I don't think that the IR has to strictly follow the IL model this one seems like a huge and unnecessary deviation.
- It doesn't follow the assembly model either. One could argue that
mov eax, ebxis assignment but that's only true ifeaxandebxhappen to be enregistered variables. Otherwise you'd be looking atmov [eax], ebxwhich is more similar to a store.
Anyone knows any advantages?
AFAIR Phoenix did have Assign but its IR was very different, looking more like assembly. I know next to nothing about LLVM but I don't think it has assignment.
category:implementation
theme:ir
skill-level:expert
cost:extra-large
fiigii, CarolEidt and GSPP
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 SuperPMIdesign-discussionOngoing discussion about design without consensusOngoing discussion about design without consensus