From c9387a674a59944639afdb99346d63a6724fcce4 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 15 Dec 2018 21:11:49 +0000 Subject: [PATCH] [X86] Begin cleaning up combineOr -> SHLD/SHRD. NFCI. In preparation for converting to funnel shifts. llvm-svn: 349286 --- lib/Target/X86/X86ISelLowering.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 72d1fb00fc9..ed6700f4279 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -36531,10 +36531,10 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG, // OR( SRL( X, C ), SHL( Y, 32 - C ) ) -> SHRD( X, Y, C ) // OR( SHL( X, C ), SRL( SRL( Y, 1 ), XOR( C, 31 ) ) ) -> SHLD( X, Y, C ) // OR( SRL( X, C ), SHL( SHL( Y, 1 ), XOR( C, 31 ) ) ) -> SHRD( X, Y, C ) - unsigned Bits = VT.getSizeInBits(); + unsigned Bits = VT.getScalarSizeInBits(); if (ShAmt1.getOpcode() == ISD::SUB) { SDValue Sum = ShAmt1.getOperand(0); - if (ConstantSDNode *SumC = dyn_cast(Sum)) { + if (auto *SumC = dyn_cast(Sum)) { SDValue ShAmt1Op1 = ShAmt1.getOperand(1); if (ShAmt1Op1.getOpcode() == ISD::TRUNCATE) ShAmt1Op1 = ShAmt1Op1.getOperand(0); @@ -36544,8 +36544,8 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG, DAG.getNode(ISD::TRUNCATE, DL, MVT::i8, ShAmt0)); } - } else if (ConstantSDNode *ShAmt1C = dyn_cast(ShAmt1)) { - ConstantSDNode *ShAmt0C = dyn_cast(ShAmt0); + } else if (auto *ShAmt1C = dyn_cast(ShAmt1)) { + auto *ShAmt0C = dyn_cast(ShAmt0); if (ShAmt0C && (ShAmt0C->getSExtValue() + ShAmt1C->getSExtValue()) == Bits) return DAG.getNode(Opc, DL, VT, N0.getOperand(0), N1.getOperand(0), @@ -36553,7 +36553,7 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG, MVT::i8, ShAmt0)); } else if (ShAmt1.getOpcode() == ISD::XOR) { SDValue Mask = ShAmt1.getOperand(1); - if (ConstantSDNode *MaskC = dyn_cast(Mask)) { + if (auto *MaskC = dyn_cast(Mask)) { unsigned InnerShift = (X86ISD::SHLD == Opc ? ISD::SRL : ISD::SHL); SDValue ShAmt1Op0 = ShAmt1.getOperand(0); if (ShAmt1Op0.getOpcode() == ISD::TRUNCATE)