[PATCH] D102907: [Verifier] Fail if vectors overrun for {insert,extract} vector intrinsics

Bradley Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 05:16:58 PDT 2021


bsmith accepted this revision.
bsmith added a comment.
This revision is now accepted and ready to land.

LGTM with a few minor nits.



================
Comment at: llvm/lib/IR/Verifier.cpp:5327-5328
+
+    // If this insertion is not the 'mixed' case where a fixed vector is
+    // inserted into a scalable vector.
+    if (VecEC.isScalable() == SubVecEC.isScalable()) {
----------------
Nit: This feels like half a sentence, I would expect a `, then ...` after this.


================
Comment at: llvm/lib/IR/Verifier.cpp:5352
            &Call);
     Assert(IdxN % ResultTy->getElementCount().getKnownMinValue() == 0,
            "experimental_vector_extract index must be a constant multiple of "
----------------
Nit: Could be `ResultEC`, as you have done in the insert case.


================
Comment at: llvm/lib/IR/Verifier.cpp:5356-5357
+
+    // If this extraction is not the 'mixed' case where a fixed vector is is
+    // extracted from a scalable vector.
+    if (VecEC.isScalable() == ResultEC.isScalable()) {
----------------
Nit: Same here as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102907



More information about the llvm-commits mailing list