[PATCH] D62793: [X86] X86DAGToDAGISel::matchBitExtract(): pattern b: truncation awareness

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 2 11:35:56 PDT 2019


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:8623
+      .zextOrTrunc(VT.getSizeInBits())
+      .isAllOnesValue();
 }
----------------
lebedev.ri wrote:
> RKSimon wrote:
> > Could you not create an AllOnes equivalent MaskedValueIsZero instead? MaskedValueIsAllOnes?
> Err, s/not//?
> "Could you create an AllOnes equivalent of MaskedValueIsZero instead? MaskedValueIsAllOnes?"
I don't think we need a DemandedElts variant so this should work.
```
/// MaskedValueIsAllOnes - Return true if 'V & Mask' is known to be all ones.
bool MaskedValueIsAllOnes(SDValue Op, const APInt &Mask, unsigned Depth = 0) const;

bool SelectionDAG::MaskedValueIsAllOnes(SDValue V, const APInt &Mask, unsigned Depth) const {
  return Mask.isSubsetOf(computeKnownBits(V, Depth).One);
}
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62793





More information about the llvm-commits mailing list