[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 23:54:42 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))
----------------
arsenm wrote:
> 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
No we're talking about the case where LHS is undef.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151340/new/
https://reviews.llvm.org/D151340
More information about the llvm-commits
mailing list