[PATCH] D98250: [RISCV] Optimize INSERT_VECTOR_ELT sequences

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 01:36:25 PST 2021


frasercrmck marked an inline comment as done.
frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2250
+    ValLo = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, Val, Zero);
+    ValHi = DAG.getNode(ISD::EXTRACT_ELEMENT, DL, MVT::i32, Val, One);
+    if (isa<ConstantSDNode>(Val) &&
----------------
craig.topper wrote:
> I'm not sure how I feel about creating these extracts that might not get used. Having them here instead of just in the non-simple path only saves us from having to call getConstant where we assign Val = ValLo?
Yeah fair enough, looking at it again in the cold light of day it doesn't seem like it brings any benefit and adds extra variables to scope in which they're never going to be used.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98250



More information about the llvm-commits mailing list