[llvm] [IR] Fix vector.splice verifier scaling by vscale for fixed length vectors (PR #170807)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 4 23:56:06 PST 2025


lukel97 wrote:

> LGTM, but the vscale handling also looks wrong to me. Shouldn't it be using the maximum value instead of the minimum, to detect the cases that are "definitely out of range" rather than "maybe out of range"?

The LangRef actually restricts immediates that "may be out of range": 

> For a scalable vector <vscale x N x eltty>, imm is a signed integer constant in the range -X <= imm < X where X=vscale_range_min * N.

But yeah I think that's overly strict. We can probably relax that to -X <= imm < X where X=vscale_range_max * N? And then copy over the wording from e.g. llvm.vector.extract

> If this condition cannot be determined statically but is false at runtime, then the result vector is a poison value

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


More information about the llvm-commits mailing list