[PATCH] D152440: [AMDGPU] Trim trailing undefs from the end of image and buffer store
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 15 03:47:02 PDT 2023
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp:387-388
+ if (!isa<Constant>(UseV) && !isa<Instruction>(UseV))
+ return DemandedElts;
+
----------------
I don't think there's any need for this. Almost everything is an Instruction or a Constant, and anything that is not will just break out of the loop on the first iteration anyway.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp:394
+ if (auto *ConstElt = dyn_cast<Constant>(Elt)) {
+ if (!ConstElt->isZeroValue() && !isa<UndefValue>(Elt))
+ break;
----------------
Should use isNullValue because we don't want to match -0.0.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152440/new/
https://reviews.llvm.org/D152440
More information about the llvm-commits
mailing list