@@ -10019,7 +10019,8 @@ SDValue DAGCombiner::visitShiftByConstant(SDNode *N) {
10019
10019
BinOpLHSVal.getOpcode() == ISD::SRL) &&
10020
10020
isa<ConstantSDNode>(BinOpLHSVal.getOperand(1));
10021
10021
bool IsCopyOrSelect = BinOpLHSVal.getOpcode() == ISD::CopyFromReg ||
10022
- BinOpLHSVal.getOpcode() == ISD::SELECT;
10022
+ BinOpLHSVal.getOpcode() == ISD::SELECT ||
10023
+ BinOpLHSVal.getOpcode() == ISD::VSELECT;
10023
10024
10024
10025
if (!IsShiftByConstant && !IsCopyOrSelect)
10025
10026
return SDValue();
@@ -13437,7 +13438,7 @@ static SDValue tryToFoldExtendOfConstant(SDNode *N, const SDLoc &DL,
13437
13438
// fold (sext (select cond, c1, c2)) -> (select cond, sext c1, sext c2)
13438
13439
// fold (zext (select cond, c1, c2)) -> (select cond, zext c1, zext c2)
13439
13440
// fold (aext (select cond, c1, c2)) -> (select cond, sext c1, sext c2)
13440
- if (N0->getOpcode() == ISD::SELECT) {
13441
+ if (N0->getOpcode() == ISD::SELECT || N0->getOpcode() == ISD::VSELECT ) {
13441
13442
SDValue Op1 = N0->getOperand(1);
13442
13443
SDValue Op2 = N0->getOperand(2);
13443
13444
if (isa<ConstantSDNode>(Op1) && isa<ConstantSDNode>(Op2) &&
@@ -17765,10 +17766,11 @@ SDValue DAGCombiner::visitFMUL(SDNode *N) {
17765
17766
// fold (fmul X, (select (fcmp X > 0.0), -1.0, 1.0)) -> (fneg (fabs X))
17766
17767
// fold (fmul X, (select (fcmp X > 0.0), 1.0, -1.0)) -> (fabs X)
17767
17768
if (Flags.hasNoNaNs() && Flags.hasNoSignedZeros() &&
17768
- (N0.getOpcode() == ISD::SELECT || N1.getOpcode() == ISD::SELECT) &&
17769
+ (N0.getOpcode() == ISD::SELECT || N0.getOpcode() == ISD::VSELECT ||
17770
+ N1.getOpcode() == ISD::SELECT || N1.getOpcode() == ISD::VSELECT) &&
17769
17771
TLI.isOperationLegal(ISD::FABS, VT)) {
17770
17772
SDValue Select = N0, X = N1;
17771
- if (Select.getOpcode() != ISD::SELECT)
17773
+ if (Select.getOpcode() != ISD::SELECT && Select.getOpcode() != ISD::VSELECT )
17772
17774
std::swap(Select, X);
17773
17775
17774
17776
SDValue Cond = Select.getOperand(0);
0 commit comments