[PATCH] D62777: [SelectionDAG] ComputeNumSignBits - support constant pool values from target

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 11:21:20 PDT 2019


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3882
+      default: break;
+      case ISD::SEXTLOAD: // '17' bits known
+        Tmp = LD->getMemoryVT().getScalarSizeInBits();
----------------
lebedev.ri wrote:
> lebedev.ri wrote:
> > I realize this is not a new comment, but why '17'?
> > Does this only load 16-bit and extends to 32-bit?
> Precommit formatting-only changes?
Not limited but I agree its annoying that it doesn't make the context of the example clear.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3882-3887
-        case ISD::SEXTLOAD:    // '17' bits known
-          Tmp = LD->getMemoryVT().getScalarSizeInBits();
-          return VTBits-Tmp+1;
-        case ISD::ZEXTLOAD:    // '16' bits known
-          Tmp = LD->getMemoryVT().getScalarSizeInBits();
-          return VTBits-Tmp;
----------------
RKSimon wrote:
> lebedev.ri wrote:
> > lebedev.ri wrote:
> > > I realize this is not a new comment, but why '17'?
> > > Does this only load 16-bit and extends to 32-bit?
> > Precommit formatting-only changes?
> Not limited but I agree its annoying that it doesn't make the context of the example clear.
Sure.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3893
+          Type *CstTy = Cst->getType();
+          if (CstTy->isVectorTy() &&
+              (NumElts * VTBits) == CstTy->getPrimitiveSizeInBits()) {
----------------
lebedev.ri wrote:
> Do you want to defer to scalar case if it's splat?
Tricky - I went for handling it here as it makes it clearer whats going on, and is probably more performant than adding calls to the splat detection code and computeKnownBits


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62777





More information about the llvm-commits mailing list