[llvm] r307895 - Use isNullConstantOrNullSplatConstant helper. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 02:39:00 PDT 2017
Author: rksimon
Date: Thu Jul 13 02:39:00 2017
New Revision: 307895
URL: http://llvm.org/viewvc/llvm-project?rev=307895&view=rev
Log:
Use isNullConstantOrNullSplatConstant helper. NFCI.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=307895&r1=307894&r2=307895&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jul 13 02:39:00 2017
@@ -3889,9 +3889,8 @@ SDValue DAGCombiner::visitAND(SDNode *N)
// Note: the SimplifyDemandedBits fold below can make an information-losing
// transform, and then we have no way to find this better fold.
if (N1C && N1C->isOne() && N0.getOpcode() == ISD::SUB) {
- ConstantSDNode *SubLHS = isConstOrConstSplat(N0.getOperand(0));
- SDValue SubRHS = N0.getOperand(1);
- if (SubLHS && SubLHS->isNullValue()) {
+ if (isNullConstantOrNullSplatConstant(N0.getOperand(0))) {
+ SDValue SubRHS = N0.getOperand(1);
if (SubRHS.getOpcode() == ISD::ZERO_EXTEND &&
SubRHS.getOperand(0).getScalarValueSizeInBits() == 1)
return SubRHS;
More information about the llvm-commits
mailing list