[PATCH] D147347: [RISCV] Use tail agnostic policy more often when lowering insert_subvector

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 2 07:12:47 PDT 2023


luke added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6589
     unsigned Policy = RISCVII::TAIL_UNDISTURBED_MASK_UNDISTURBED;
-    if (VecVT.isFixedLengthVector() &&
-        OrigIdx + 1 == VecVT.getVectorNumElements())
+    if (VecVT.isFixedLengthVector() && EndIndex >= VecVT.getVectorNumElements())
       Policy = RISCVII::TAIL_AGNOSTIC;
----------------
craig.topper wrote:
> luke wrote:
> > craig.topper wrote:
> > > Can EndIndex ever be > than VecVT.getVectorNumElements()?
> > Would cases like `insert_subvector a:v4i8, b:v2i8, 3:i32` reach here? Not sure if this is legal, but I thought EndIndex here would be 2+3=5
> I think the insertion index must be a multiple of the known minimum length of the subvector.
Ah you're right, that makes sense. I put in an assert to see if `EndIndex > VecVT.getVectorNumElements()` ever triggers, and it doesn't seem to.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147347



More information about the llvm-commits mailing list