Skip to content

Commit cff753f

Browse files
committed
[X86] SimplifyDemandedVectorEltsForTargetNode - simplify X86ISD::VBROADCAST of 0'th element handling. NFC.
Avoid duplicate TLO.CombineTo calls.
1 parent 57f5d8f commit cff753f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42866,9 +42866,8 @@ bool X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode(
4286642866
// Don't bother broadcasting if we just need the 0'th element.
4286742867
if (DemandedElts == 1) {
4286842868
if (!SrcVT.isVector())
42869-
return TLO.CombineTo(
42870-
Op, TLO.DAG.getNode(ISD::SCALAR_TO_VECTOR, SDLoc(Op), VT, Src));
42871-
if (Src.getValueType() != VT)
42869+
Src = TLO.DAG.getNode(ISD::SCALAR_TO_VECTOR, SDLoc(Op), VT, Src);
42870+
else if (Src.getValueType() != VT)
4287242871
Src = widenSubVector(VT.getSimpleVT(), Src, false, Subtarget, TLO.DAG,
4287342872
SDLoc(Op));
4287442873
return TLO.CombineTo(Op, Src);

0 commit comments

Comments
 (0)