Skip to content

Commit 69b80e3

Browse files
committed
fixup! Use Op->ops(). Use llvm::any_of.
1 parent 23ca7cf commit 69b80e3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,12 +2985,11 @@ bool TargetLowering::SimplifyDemandedBits(
29852985
if (!isTargetCanonicalConstantNode(Op) &&
29862986
DemandedBits.isSubsetOf(Known.Zero | Known.One)) {
29872987
// Avoid folding to a constant if any OpaqueConstant is involved.
2988-
const SDNode *N = Op.getNode();
2989-
for (SDValue Op : N->ops()) {
2990-
if (auto *C = dyn_cast<ConstantSDNode>(Op))
2991-
if (C->isOpaque())
2992-
return false;
2993-
}
2988+
if (llvm::any_of(Op->ops(), [](SDValue V) {
2989+
auto *C = dyn_cast<ConstantSDNode>(V);
2990+
return C && C->isOpaque();
2991+
}))
2992+
return false;
29942993
if (VT.isInteger())
29952994
return TLO.CombineTo(Op, TLO.DAG.getConstant(Known.One, dl, VT));
29962995
if (VT.isFloatingPoint())

0 commit comments

Comments
 (0)