[PATCH] D67767: [AMDGPU] Add llvm.amdgcn.wqm.demote intrinsic and live mask tracking

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 02:50:08 PST 2020


critson added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstructions.td:424
+}
+} // End Defs = [EXEC]
+} // End Uses = [EXEC]
----------------
foad wrote:
> EXEC,SCC
Thanks!


================
Comment at: llvm/test/CodeGen/AMDGPU/atomic_optimizations_pixelshader.ll:210-211
 ; GFX8:       ; %bb.0: ; %entry
-; GFX8-NEXT:    s_mov_b64 s[10:11], exec
+; GFX8-NEXT:    s_mov_b64 s[8:9], exec
+; GFX8-NEXT:    s_mov_b64 s[10:11], s[8:9]
 ; GFX8-NEXT:    v_mov_b32_e32 v2, v0
----------------
foad wrote:
> Why the extra move here?
This is unfortunate cruft from moving WQM pass later in compiler where there is less COPY elimination.
I have been thinking about putting some additional COPY clean up optimisations in another pass.
I had originally put some in WQM pass, but agreed with Nicolai this was probably not appropriate as the pass is already getting quite complicated.
In this specific case, first copy is saving live lane mask at begin of shader, second copy is PS_LIVE which copies live lane mask.
In practice these are very unlikely to be next to each other, and determining that they are the trivial copies of each other will need to consider control flow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67767/new/

https://reviews.llvm.org/D67767



More information about the llvm-commits mailing list