-
Notifications
You must be signed in to change notification settings - Fork 5.4k
LSRA Reg Optional: Folding of operations using a tree temp #6863
Copy link
Copy link
Closed
Labels
area-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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue
Milestone
Metadata
Metadata
Assignees
Labels
area-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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Say we have the following expr
a = (b + (c + (d+ (e+f))))
in LIR form
t0 = e+f
t1 = t0+d
t2 = t1+c
a = t2+b
Say it is profitable to not to allocate a reg to Use position of '+' in (e+f). That is tree temp t0 needs to be spilled to memory. Furthermore it is profitable to not to allocate a reg to both use and def positions of '+' in (t0+d) and (t1+c)
Since all of these tree temps are not live at the same time, using a single tree temp, we can generate the following
reg = e+f
spill reg to stack location given by spill tmp1
add [addr of tmp1], reg of d
add [add or tmp1], reg of c
mov a'reg, b's reg
add a'reg, [addr of tmp1]
To perform such an optimization, LSRA would need to annotate a tree node with a spill temp number that codegen is supposed to use for spill/reload purposes.
category:cq
theme:register-allocator
skill-level:expert
cost:medium