[PATCH] D122769: [RISCV] Add a prepass to vsetvli insertion to propagate VLMAX vsetvli to the instructions.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 11:45:02 PDT 2022


reames added a comment.

Any chance we can get more tests here?



================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:895
+    // Look for VLMAX vsetvlis.
+    if (!(isVectorConfigInstr(MI) && MI.getOperand(1).isReg() &&
+          MI.getOperand(1).getReg() == RISCV::X0 &&
----------------
Pulling out a helper function to match this would help readability for me.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:913
+      uint64_t TSFlags = UseMI.getDesc().TSFlags;
+      if (RISCVII::hasSEWOp(TSFlags) && RISCVII::hasVLOp(TSFlags)) {
+        unsigned NumOperands = UseMI.getNumExplicitOperands();
----------------
Can you use an early continue to reduce nesting here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122769



More information about the llvm-commits mailing list