[PATCH] D124961: [riscv] Use X0 for destination of VSETVLI instruction if result unused

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 00:56:03 PDT 2022


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:1224
+    // through to check for VSETVLIs which write to an unused destination.
+    // For the non X0, X0 variant, we can replace the destination register
+    // with X0 to reduce register pressure.  This is really a generic
----------------
I know we have `PseudoVSETVLIX0`, but is it really an invariant that `PseudoVSETVLI` //never// has `X0, X0` at this stage? Should we maybe add an assert to be a bit more sure? If for whatever reason we do have `X0, X0` this would (subtly) generate some wrong code.


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

https://reviews.llvm.org/D124961



More information about the llvm-commits mailing list