[PATCH] D105283: [VP] Introducing VectorBuilder, the VP intrinsic builder

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 11:47:34 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/IR/VectorBuilder.cpp:86
+    // Insert mask and evl operands in between the instruction operands.
+    for (size_t ParamIdx = 0, VPParamIdx = 0; VPParamIdx < NumVPParams;
+         ++ParamIdx, ++VPParamIdx) {
----------------
This loop doesn't work if VL is before mask and they are adjacent to each other. VL will increment VPParamIdx, but don't re-check mask after adding VL.

I think the for statement should be reponsible for incrementing VPParamIdx only. And ParamIdx should only be incremented in the loop body then a parameter from InstOpsArray is pushed. There should be no increments of VPParamIdx in the loop body.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105283



More information about the llvm-commits mailing list