[PATCH] D103277: [RISCV] Teach VSETVLI insertion to look through PHIs to prove we don't need to insert a vsetvli.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 14:44:58 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:36
 
+static cl::opt<bool> DisableInsertVSETVLPHIOpt(
+    "riscv-disable-insert-vsetvl-phi-opt", cl::init(false), cl::Hidden,
----------------
rogfer01 wrote:
> Just curious here: do you foresee this might get expensive or this is a debugging utility?
Paranoia. Combining phis and data flow made me a little nervous. Our earlier internal version of this in the EPIRemoveRedundantVSETVLGlobal pass was missing the check that the phi was in the same basic block. A miscompile from it was found months later.

I wonder if we should also have a disable on the global cross BB code. I think EPIRemoveRedundantVSETVLGlobal has a disable right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103277



More information about the llvm-commits mailing list