[PATCH] D33137: [DAGCombiner] use narrow vector ops to eliminate concat/extract (PR32790)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 11:17:31 PDT 2017


spatel added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14476
+  SDValue BinOp = Extract->getOperand(0);
+  if (BinOp.getOpcode() == ISD::BITCAST)
+    BinOp = BinOp.getOperand(0);
----------------
RKSimon wrote:
> spatel wrote:
> > RKSimon wrote:
> > > I'm starting to think that X86ISelLowering's peekThroughBitcasts and peekThroughOneUseBitcasts helpers should be exposed globally.
> > Probably a good idea. Although we always fold a bitcast-of-a-bitcast, right? I've never seen a need for those to loop.
> Interestingly, there are a load of codegen regressions if you tweak them to just peek through the first bitcast.....
Update on this one (and I suppose it should be obvious in hindsight): we're missing basic folds in the cases I looked at so far. 

Ie, given that we have a generic DAGCombine rule to fold bitcast(bitcast(x)), there shouldn't be any reason that we would do worse if that rule was applied before some other fold.

It's independent of this patch, but I'll start trying to solve those regressions, so we can get rid of those peekThroughBitcast() loops.


https://reviews.llvm.org/D33137





More information about the llvm-commits mailing list