[PATCH] D118973: [NVPTX] Eliminate StoreRetval instructions with undef operand
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 4 10:41:51 PST 2022
tra added a comment.
LGTM in principle, modulo tests as they need to actually check that we do not produce unwanted stores.
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
================
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]];
----------------
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.
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