[llvm] AMDGPU: Simplify demanded bits on readlane/writeline index arguments (PR #117963)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 07:24:58 PST 2024


================
@@ -450,6 +450,37 @@ static bool isTriviallyUniform(const Use &U) {
   return false;
 }
 
+/// Simplify a lane index operand (e.g. llvm.amdgcn.readlane src1).
+///
+/// The instruction only reads the low 5 bits for wave32, and 6 bits for wave64.
+bool GCNTTIImpl::simplifyDemandedLaneMaskArg(InstCombiner &IC,
+                                             IntrinsicInst &II,
+                                             unsigned LaneArgIdx) const {
+  unsigned MaskBits = ST->getWavefrontSizeLog2();
----------------
jayfoad wrote:

I haven't been following closely, but isn't wave size a tri-state thing now, 32 or 64 or unknown? What does getWavefrontSizeLog2 return if it's unknown?

https://github.com/llvm/llvm-project/pull/117963


More information about the llvm-commits mailing list