[PATCH] D86789: [DAGCombiner] Fold an AND of a masked load into a zext_masked_load

Sam Tebbs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 06:16:22 PDT 2020


samtebbs marked 4 inline comments as done.
samtebbs added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5299
+        bool ValidZExt = true;
+        for (unsigned int i = 0; i < BVec->getNumOperands(); i++) {
+          SDValue Operand = BVec->getOperand(i);
----------------
RKSimon wrote:
> samtebbs wrote:
> > dmgreen wrote:
> > > Can this make use of the BuildVectorSDNode::getConstantSplatNode or isBuildVectorOfConstantSDNodes or something like it?
> > Using that is much better, thanks.
> Sorry I'm away from my devmachine atm - I can't remember the APInt method exactly but I think you can do something like:
> ```
> Splat->getAPIntValue()->isMask((uint64_t)ElementSize)
> ```
Thanks, that's much cleaner.


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

https://reviews.llvm.org/D86789



More information about the llvm-commits mailing list