Skip to content

Commit

Permalink
[X86] SimplifyDemandedVectorEltsForTargetNode - simplify X86ISD::VBRO…
Browse files Browse the repository at this point in the history
…ADCAST of 0'th element handling. NFC.

Avoid duplicate TLO.CombineTo calls.
  • Loading branch information
RKSimon committed Sep 23, 2024
1 parent 57f5d8f commit cff753f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42866,9 +42866,8 @@ bool X86TargetLowering::SimplifyDemandedVectorEltsForTargetNode(
// Don't bother broadcasting if we just need the 0'th element.
if (DemandedElts == 1) {
if (!SrcVT.isVector())
return TLO.CombineTo(
Op, TLO.DAG.getNode(ISD::SCALAR_TO_VECTOR, SDLoc(Op), VT, Src));
if (Src.getValueType() != VT)
Src = TLO.DAG.getNode(ISD::SCALAR_TO_VECTOR, SDLoc(Op), VT, Src);
else if (Src.getValueType() != VT)
Src = widenSubVector(VT.getSimpleVT(), Src, false, Subtarget, TLO.DAG,
SDLoc(Op));
return TLO.CombineTo(Op, Src);
Expand Down

0 comments on commit cff753f

Please sign in to comment.