[PATCH] D108916: [RISCV] Optimize (add (shl x, c0), (shl y, c1)) with SH*ADD

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 16 08:55:32 PDT 2021


luismarques added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5773-5774
+  EVT VT = N->getValueType(0);
+  if (VT.isVector() || VT.getSizeInBits() > Subtarget.getXLen())
+    return SDValue();
+
----------------
craig.topper wrote:
> luismarques wrote:
> > See craig's comment in D109729: The `VT.getSizeInBits() > Subtarget->getXLen()` should never fail. If the VT is scalar it must be XLenVT.
> This comment was not correct for this patch. The XLen check is needed here.
> This comment was not correct for this patch. The XLen check is needed here.

Yup, my bad. Sorry!


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

https://reviews.llvm.org/D108916



More information about the llvm-commits mailing list