[PATCH] D115933: [IR] Change vector.splice intrinsic to reject out-of-bounds indices
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 20 07:10:36 PST 2021
sdesmalen added inline comments.
================
Comment at: llvm/docs/LangRef.rst:17208-17209
The first two operands are vectors with the same type. The third argument
-``imm`` is the start index, modulo VL, where VL is the runtime vector length of
-the source/result vector. The ``imm`` is a signed integer constant in the range
-``-VL <= imm < VL``. For values outside of this range the result is poison.
+``imm`` is the start index, modulo VL, where VL is the known minimum vector
+length of the source/result vector. The ``imm`` is a signed integer constant
+in the range ``-VL <= imm < VL``. For values outside of this range the
----------------
this isn't strictly correct, for a `<vscale x 4 x i32>` and the IR being compiled with `vscale_range(2, N)` (for N>=2) then `imm = -5` should still be a valid immediate.
It would be better to phrase this in terms of vscale_range directly.
================
Comment at: llvm/lib/IR/Verifier.cpp:5345-5346
+ (Idx >= 0 && Idx < KnownMinNumElements),
+ "The splice index exceeds the range [-VL, VL-1] where VL is the "
+ "known minimum number of elements in the vector",
+ &Call);
----------------
the number of elements in the vector for the vscale_range being compiled for.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115933/new/
https://reviews.llvm.org/D115933
More information about the llvm-commits
mailing list