Skip to content

Commit 86f6692

Browse files
committed
[DAG]: Refactored tryToFoldExtendSelectLoad
1 parent 7ffcd4d commit 86f6692

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13857,12 +13857,13 @@ static SDValue tryToFoldExtendSelectLoad(SDNode *N, const TargetLowering &TLI,
1385713857
Opcode == ISD::ANY_EXTEND) &&
1385813858
"Expected EXTEND dag node in input!");
1385913859

13860-
if (!(N0->getOpcode() == ISD::SELECT || N0->getOpcode() == ISD::VSELECT) ||
13861-
!N0.hasOneUse())
13860+
SDValue Cond, Op1, Op2;
13861+
if (!sd_match(N0,
13862+
m_SelectLike(m_Value(Cond), m_Value(Op1), m_Value(Op2))) ||
13863+
!N0->hasOneUse()) {
1386213864
return SDValue();
13865+
}
1386313866

13864-
SDValue Op1 = N0->getOperand(1);
13865-
SDValue Op2 = N0->getOperand(2);
1386613867
if (!isCompatibleLoad(Op1, Opcode) || !isCompatibleLoad(Op2, Opcode))
1386713868
return SDValue();
1386813869

0 commit comments

Comments
 (0)