This pass will convert uniform global address space loads to constant address
space loads when the load's pointer points to memory which has not been
modified by the function.
Details
Diff Detail
Event Timeline
lib/Target/AMDGPU/GCNOptimizeUniformMemOps.cpp | ||
---|---|---|
1 | I'm not sure Optimize is the right name to use for this. Maybe promote or scalarize? | |
22 | Typo bee | |
44 | Why would this need to create globals? | |
84 | Typo Optmize | |
100 | Can be early return | |
103 | there is a getPointerElementType helper | |
113–114 | I think there's a new skipFunction test instead | |
test/CodeGen/AMDGPU/uniform-mem-opt.ll | ||
2 | There should be a run line / test with just opt. With opt you could write a test with a calls that might write through or capture the pointer |
This is not valid to run on just any function. A value shall not be written to memory starting from the kernel. We currently inline everything, but when we have calls that will be an error.
lib/Target/AMDGPU/GCNOptimizeUniformMemOps.cpp | ||
---|---|---|
105 | According to memory model global and constant do not alias. Casts are only possible between flat and any non-constant segment. |
I'm not sure Optimize is the right name to use for this. Maybe promote or scalarize?
GCNPromoteUniformLoadsToSMRD?