[PATCH] D151340: AMDGPU: Refine undef handling for llvm.amdgcn.class intrinsic

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 23:25:42 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp:471
 
+    // llvm.amdgcn.class(undef, _) -> undef
+    if (IC.getSimplifyQuery().isUndefValue(Src0))
----------------
foad wrote:
> I don't think this is sound, e.g if the RHS is 0 (but not a ConstantInt) then the result should be 0, not undef.
> 
> Perhaps you could fold it to `RHS != 0`?
icmp ne x, undef folds to undef, so that would be the same thing 


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

https://reviews.llvm.org/D151340



More information about the llvm-commits mailing list