[PATCH] D57997: [SDAG] Support vector UMULO/SMULO

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 18 12:43:39 PST 2019


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:981
-                             DAG.getIntPtrConstant(SmallVT.getSizeInBits(),
-                                                   DL));
     Overflow = DAG.getSetCC(DL, N->getValueType(1), Hi,
----------------
nikic wrote:
> RKSimon wrote:
> > This needs fixing right away as a separate commit - we should be using getShiftAmountTy. I'm happy for you to use getScalarSizeInBits straight away as well.
> This is a somewhat odd case: The existing code here was actually correct, and my change wasn't. The problem is that we're still during legalization and the integer sizes involved may have more bits than can fit into the shift amount type, so just using it can lead to asserts if odd types like `i300` are used (I added a testcase). I'm now using the getShiftAmountTyForConstant() helper to properly handle this.
SGTM


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

https://reviews.llvm.org/D57997





More information about the llvm-commits mailing list