[PATCH] D131478: AMDGPU: mbcnt allow for non-zero src1 for known-bits

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 19 06:12:18 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:4606
+      // These return at most the (wavefront size - 1) + src1
+      // As long as src1 is an immediate we can calc known bits
+      KnownBits Src1Known = DAG.computeKnownBits(Op.getOperand(2), Depth + 1);
----------------
Comment seems misleading since this can give useful results even when src1 is not an immediate.

Also you could make this slightly simpler and more accurate by constructing a KnownBits for 0..(wavefront size - 1) (i.e. the high 26 or 27 bits are known zero) and then calling computeForAddSub to combine it with the known bits of src1.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131478



More information about the llvm-commits mailing list