[PATCH] D140546: [AMDGPU] Remove permlane discard vdst_in optimization from isel

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 06:59:07 PST 2022


nlopes added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/llvm.amdgcn.permlane.ll:853
   %tidx = call i32 @llvm.amdgcn.workitem.id.x()
-  %v = call i32 @llvm.amdgcn.permlane16(i32 12345, i32 %tidx, i32 %src1, i32 %src2, i1 1, i1 0)
+  %v = call i32 @llvm.amdgcn.permlane16(i32 undef, i32 %tidx, i32 %src1, i32 %src2, i1 1, i1 0)
   store i32 %v, ptr addrspace(1) %out
----------------
foad wrote:
> arsenm wrote:
> > foad wrote:
> > > arsenm wrote:
> > > > Should use poison
> > > Really? I read that "Most instructions return ‘poison’ when one of their arguments is ‘poison’" and that's not what I want here. Besides I am just mimicking InstCombine which still uses undef for this optimization.
> > undef is soft deprecated. Undef should be freeze poison
> + @nlopes So is "freeze poison" the best option here? I guess just "poison" would work, since nothing is actually going to remove the whole intrinsic in a codegen test, but it seems conceptually wrong.
llvm.amdgcn.permlane16 doesn't seem to be documented, so I have no clue what it does.
If poison is not a good value here, and a constant is not what you want, you can always add a new i32 argument to the test function and use it. That's how you get a fresh variable for free.

Thanks for not using undef btw!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140546



More information about the llvm-commits mailing list