[PATCH] D119921: [RISCV] Teach VSETVLInsert to optimize vsetvli for ScalarMoveInstr

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 01:02:20 PST 2022


jacquesguan added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:1056
+          if (isScalarMoveInstr(MI))
+            ScalarMoveVSETVLI = MI.getPrevNode();
           CurInfo = NewInfo;
----------------
The scalar move instruction may share a VSETVLI with one or some other instruction.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:1092
           }
-          if (NeedInsertVSETVLI)
+          if (ScalarMoveVSETVLI) {
+            if (NewInfo.hasAVLImm() &&
----------------
As the former comment, the scalar move instruction may share a VSETVLI with one or some other instructions, so in this situation, we could not only think about the scalar move instruction, other instructions may care about the LMUL.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119921



More information about the llvm-commits mailing list