[PATCH] D47156: [DAGCombiner] isAllOnesConstantOrAllOnesSplatConstant(): look through bitcasts

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 13:04:02 PDT 2018


lebedev.ri added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:917
+  if (N.getOpcode() == ISD::BITCAST)
+    return isAllOnesConstantOrAllOnesSplatConstant(N.getOperand(0));
   unsigned BitWidth = N.getScalarValueSizeInBits();
----------------
RKSimon wrote:
> Don't make it recursive:
> ```
> while (N.getOpcode() == ISD::BITCAST)
>   N = N->getOperand(0);
> ```
> 
> 
Oh, i can do that?
I was under impression that would change the the N itself (in IR/DAG), not just the variable N here.


Repository:
  rL LLVM

https://reviews.llvm.org/D47156





More information about the llvm-commits mailing list