[llvm] [AMDGPU] Rework dot4 signedness checks (PR #68757)

Jeffrey Byrnes via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 17:08:04 PST 2023


jrbyrnes wrote:

A more complete rework of the signedness semantics matching to remove ByteProvider.IsSigned.

Use computeKnownBits as suggested by @arsenm . 

Special case when we don't know the sign bit for one or both ops: Given that we have valid ByteProviders for each op in the candidate mul, the upper bits _must_ be extension bits. Thus, if we don't know the sign bit, one of two things must have occurred: 1. sign extend from unknown bit, 2. any extend. In either case, we can use the sign extend version of dot4 for this op. Thus, if the other op is also unknown, or known to have its sign bit set (this implies it must have been sign extended), we can use the signed version of dot.

A draft while I test the new implementation.

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


More information about the llvm-commits mailing list