[PATCH] D118973: [NVPTX] Eliminate StoreRetval instructions with undef operand

Daniil Kovalev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 8 11:54:41 PST 2022


kovdan01 added a comment.

@tra Thanks for your review! Fixed tests.

> Also, the change is unlikely to affect the actual GPU code, only PTX, as ptxas is smart enough to eliminate undef stores: https://godbolt.org/z/fdb1hGdxW

Hmm, it's an interesting notice, however, I suppose that enhancing PTX code also looks valuable.



================
Comment at: llvm/test/CodeGen/NVPTX/store-retval.ll:33-38
+  ; CHECK:       st.param.b32 [func_retval0+32],  [[A]];
+  ; CHECK:       st.param.b32 [func_retval0+36],  [[B]];
+  ; CHECK:       st.param.b32 [func_retval0+40],  [[C]];
+  ; CHECK:       st.param.b32 [func_retval0+44],  [[D]];
+  ; CHECK:       mov.u32 [[E:%r[0-9]+]], 0;
+  ; CHECK:       st.param.b32 [func_retval0+108], [[E]];
----------------
tra wrote:
> This only verifies that the known values were stored, but the test would still pass on the current code which also stores the undef values.
> You do need a handful of `CHECK-NOT` for st-param before/after  the stores of valid values.
Fixed, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118973



More information about the llvm-commits mailing list