[PATCH] D22198: AMDGPU: Do not clobber SCC in SIWholeQuadMode

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 06:14:58 PDT 2016


nhaehnle added a comment.

WQM is needed for correctness of pixel shaders. It must be enabled for all calculations that feed into derivative calculations (explicit ones via DS and implicit ones via image sample instructions), and it must be disabled for all stores.


================
Comment at: test/CodeGen/AMDGPU/wqm.ll:423
@@ -422,1 +422,3 @@
 
+; Test awareness that s_wqm_b64 clobbers SCC.
+;
----------------
arsenm wrote:
> I don't see check lines for the cmp + select restore pattern here. Where is the scc def? This test also probably needs a comment
That's because I didn't actually manage to concoct a test where the pattern is unavoidable. Usually, the SCC def ends up right before the SCC use, so that the WQM instruction can just be moved around it.

I've tested the pattern with some artificial hacks in the code (in the latest version by setting First == Last in prepareInsertion).

The problem is that I cannot prove that it will never be needed. For example, it might be needed if the machine scheduler makes unusual decisions about moving store instructions between the SCC def and the SCC use.


https://reviews.llvm.org/D22198





More information about the llvm-commits mailing list