[PATCH] D116277: [RISCV] Use vmv.s.x to build one element splat vector.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 01:26:26 PST 2022


jacquesguan added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2253
     Scalar = DAG.getNode(ExtOpc, DL, XLenVT, Scalar);
+    ConstantSDNode *Const = dyn_cast<ConstantSDNode>(Scalar);
+    // If VL is 1 and the scalar value won't benefit from immediate, we could
----------------
craig.topper wrote:
> Use `bool` and `isa` instead of `dyn_cast` since you don't care about the value.
I add a check if the constant could be an immediate in the below if condition.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116277



More information about the llvm-commits mailing list