@@ -2635,14 +2635,14 @@ void AArch64TargetLowering::computeKnownBitsForTargetNode(
26352635 Known = KnownBits::makeConstant(
26362636 APInt(Known.getBitWidth(),
26372637 (~Op->getConstantOperandVal(0) << Op->getConstantOperandVal(1)),
2638- false, true));
2638+ /*isSigned*/ false, /*implicitTrunc*/ true));
26392639 break;
26402640 }
26412641 case AArch64ISD::MVNImsl: {
26422642 Known = KnownBits::makeConstant(
26432643 APInt(Known.getBitWidth(),
26442644 ~(Op->getConstantOperandVal(0) << Op->getConstantOperandVal(1)),
2645- false, true));
2645+ /*isSigned*/ false, /*implicitTrunc*/ true));
26462646 break;
26472647 }
26482648 case AArch64ISD::LOADgot:
@@ -30667,6 +30667,9 @@ bool AArch64TargetLowering::isTargetCanonicalConstantNode(SDValue Op) const {
3066730667 Op.getOpcode() == AArch64ISD::MOVIedit ||
3066830668 Op.getOpcode() == AArch64ISD::MVNIshift ||
3066930669 Op.getOpcode() == AArch64ISD::MVNImsl ||
30670+ // Ignoring fneg(movi(0)), because if it is folded to FPConstant(-0.0),
30671+ // ISel will select fmov(mov i64 0x8000000000000000), resulting in a
30672+ // fmov from fpr to gpr, which is more expensive than fneg(movi(0))
3067030673 (Op.getOpcode() == ISD::FNEG &&
3067130674 Op.getOperand(0).getOpcode() == AArch64ISD::MOVIedit &&
3067230675 Op.getOperand(0).getConstantOperandVal(0) == 0) ||
0 commit comments