[PATCH] D106857: [RISCV] Teach VSETVLI insertion to merge the unused VSETVLI with the one need to be insert after it.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 27 02:57:32 PDT 2021


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:636
   VSETVLIInfo CurInfo;
+  MachineInstr *VSetMI = nullptr;
 
----------------
Could this be a property of `VSETVLIInfo` somehow? It seems odd to track two separate bits of state.

If not I think the variable needs a better name.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:677
           insertVSETVLI(MBB, MI, NewInfo, BlockInfo[MBB.getNumber()].Pred);
           CurInfo = NewInfo;
         }
----------------
Is this path not setting `VSetMI` by inserting a VSETVLI?


================
Comment at: llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+experimental-v \
----------------
It would be helpful if the test case was pre-committed so we can better see the changes introduced by this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106857



More information about the llvm-commits mailing list