Skip to content

Commit 696f3a5

Browse files
committed
[X86] Remove getNumOperands
1 parent 1ba8e32 commit 696f3a5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53822,11 +53822,17 @@ static SDValue combineTruncatedArithmetic(SDNode *N, SelectionDAG &DAG,
5382253822
return SDValue();
5382353823

5382453824
if (VT == MVT::i32 && SrcVT == MVT::i64 && SrcOpcode == ISD::SRL &&
53825-
Src.getOperand(0).getNumOperands() == 2 &&
53826-
isa<ConstantSDNode>(Src.getOperand(1)) &&
53827-
isa<ConstantSDNode>(Src.getOperand(0).getOperand(1))) {
53825+
isa<ConstantSDNode>(Src.getOperand(1))) {
53826+
53827+
unsigned SrcOpOpcode = Src.getOperand(0).getOpcode();
53828+
if ((SrcOpOpcode != ISD::ADD && SrcOpOpcode != ISD::OR &&
53829+
SrcOpOpcode != ISD::XOR) ||
53830+
!isa<ConstantSDNode>(Src.getOperand(0).getOperand(1)))
53831+
return SDValue();
53832+
5382853833
if (SDValue R = combinei64TruncSrlConstant(Src, VT, DAG, DL))
5382953834
return R;
53835+
5383053836
return SDValue();
5383153837
}
5383253838

0 commit comments

Comments
 (0)