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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 13:29:07 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp:471
 
+    // llvm.amdgcn.class(undef, _) -> undef
+    if (IC.getSimplifyQuery().isUndefValue(Src0))
----------------
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`?


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

https://reviews.llvm.org/D151340



More information about the llvm-commits mailing list