From 37a4621fb6ffc121ec78936a8243219ff53be760 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 16 Apr 2021 17:26:32 +0100 Subject: [PATCH] [DAG] SelectionDAG::isSplatValue - early out if binop is not splat. NFCI. Just return false if we fail to match splats - the remainder of the code is for (fixed)vector operations - shuffles/insertions etc. --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 71964b3de2b0..d24455572273 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2472,7 +2472,7 @@ bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts, return true; case ISD::ADD: case ISD::SUB: - case ISD::AND: + case ISD::AND: case ISD::XOR: case ISD::OR: { APInt UndefLHS, UndefRHS; @@ -2483,7 +2483,7 @@ bool SelectionDAG::isSplatValue(SDValue V, const APInt &DemandedElts, UndefElts = UndefLHS | UndefRHS; return true; } - break; + return false; } case ISD::ABS: case ISD::TRUNCATE: