[PATCH] D121881: [RISCV][RVV] Select unmasked TU RVV pseudos in a DAG post-process

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 10:39:46 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2264
   if (RISCVII::hasVecPolicyOp(MaskedMCID.TSFlags)) {
     // The last operand of the pseudo is the policy op, but we're expecting a
     // Glue operand last. We may also have a chain.
----------------
"we're expecting" here doesn't make sense does it? It's more like "but we might have a Glue operand last".


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:436
   Pseudo UnmaskedPseudo = !cast<Pseudo>(!subst("_MASK", "", NAME));
+  Pseudo UnmaskedTuPseudo = !cond(HasTU : !cast<Pseudo>(!subst("_MASK", "", NAME # "_TU")),
+                                  true : PseudoNoTU);
----------------
Can you use `!if` instead of `!cond`? Then you don't need the `true : ` part


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:436
   Pseudo UnmaskedPseudo = !cast<Pseudo>(!subst("_MASK", "", NAME));
+  Pseudo UnmaskedTuPseudo = !cond(HasTU : !cast<Pseudo>(!subst("_MASK", "", NAME # "_TU")),
+                                  true : PseudoNoTU);
----------------
craig.topper wrote:
> Can you use `!if` instead of `!cond`? Then you don't need the `true : ` part
Instead of having a Dummy Pseudo, could you use the MaskedPseudo value. Then in RISCVISelDAGToDAG.cpp detect that the return value was the same opcode you started with?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121881



More information about the llvm-commits mailing list