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

Shilei Tian via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 27 21:03:54 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->isWaveSizeKnown() && ST->isWave32() ? 5 : 6;
----------------
shiltian wrote:

If we default to 64, can't we just use `getWavefrontSize`?

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


More information about the llvm-branch-commits mailing list