Skip to content

Commit 65a9254

Browse files
committed
[X86] canonicalizeShuffleWithOp - pull out repeated flag settings to IsMergeableWithShuffle lambda. NFC.
Prep work before tweaking the flags in a future patch.
1 parent d9183fd commit 65a9254

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41598,10 +41598,10 @@ static SDValue canonicalizeShuffleWithOp(SDValue N, SelectionDAG &DAG,
4159841598
if (TLI.isBinOp(SrcOpcode) && IsSafeToMoveShuffle(N0, SrcOpcode)) {
4159941599
SDValue Op00 = peekThroughOneUseBitcasts(N0.getOperand(0));
4160041600
SDValue Op01 = peekThroughOneUseBitcasts(N0.getOperand(1));
41601-
if (IsMergeableWithShuffle(Op00, Opc != X86ISD::VPERMI,
41602-
Opc != X86ISD::PSHUFB) ||
41603-
IsMergeableWithShuffle(Op01, Opc != X86ISD::VPERMI,
41604-
Opc != X86ISD::PSHUFB)) {
41601+
bool FoldShuf = Opc != X86ISD::VPERMI;
41602+
bool FoldLoad = Opc != X86ISD::PSHUFB;
41603+
if (IsMergeableWithShuffle(Op00, FoldShuf, FoldLoad) ||
41604+
IsMergeableWithShuffle(Op01, FoldShuf, FoldLoad)) {
4160541605
SDValue LHS, RHS;
4160641606
Op00 = DAG.getBitcast(ShuffleVT, Op00);
4160741607
Op01 = DAG.getBitcast(ShuffleVT, Op01);

0 commit comments

Comments
 (0)