Skip to content

Commit

Permalink
[X86] lowerShuffleOfExtractsAsVperm - move hasOneUse checks to the en…
Browse files Browse the repository at this point in the history
…d of the match. NFCI.

Check the cheap parts of the pattern first, and make the more expensive hasOneUse() call as late as possible.
  • Loading branch information
RKSimon committed Apr 2, 2023
1 parent e5bdf0f commit b18835f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14815,10 +14815,10 @@ static SDValue lowerShuffleOfExtractsAsVperm(const SDLoc &DL, SDValue N0,
"VPERM* family of shuffles requires 32-bit or 64-bit elements");

// Check that both sources are extracts of the same source vector.
if (!N0.hasOneUse() || !N1.hasOneUse() ||
N0.getOpcode() != ISD::EXTRACT_SUBVECTOR ||
if (N0.getOpcode() != ISD::EXTRACT_SUBVECTOR ||
N1.getOpcode() != ISD::EXTRACT_SUBVECTOR ||
N0.getOperand(0) != N1.getOperand(0))
N0.getOperand(0) != N1.getOperand(0) ||
!N0.hasOneUse() || !N1.hasOneUse())
return SDValue();

SDValue WideVec = N0.getOperand(0);
Expand Down

0 comments on commit b18835f

Please sign in to comment.