|
@@ -7759,7 +7759,7 @@ static SDValue lowerBuildVectorAsBroadcast(BuildVectorSDNode *BVOp,
|
|
// TODO: If multiple splats are generated to load the same constant,
|
|
// TODO: If multiple splats are generated to load the same constant,
|
|
// it may be detrimental to overall size. There needs to be a way to detect
|
|
// it may be detrimental to overall size. There needs to be a way to detect
|
|
// that condition to know if this is truly a size win.
|
|
// that condition to know if this is truly a size win.
|
|
- bool OptForSize = DAG.getMachineFunction().getFunction().optForSize();
|
|
|
|
|
|
+ bool OptForSize = DAG.getMachineFunction().getFunction().hasOptSize();
|
|
|
|
|
|
// Handle broadcasting a single constant scalar from the constant pool
|
|
// Handle broadcasting a single constant scalar from the constant pool
|
|
// into a vector.
|
|
// into a vector.
|
|
@@ -10666,7 +10666,7 @@ static SDValue lowerShuffleAsBlend(const SDLoc &DL, MVT VT, SDValue V1,
|
|
case MVT::v32i16:
|
|
case MVT::v32i16:
|
|
case MVT::v64i8: {
|
|
case MVT::v64i8: {
|
|
// Attempt to lower to a bitmask if we can. Only if not optimizing for size.
|
|
// Attempt to lower to a bitmask if we can. Only if not optimizing for size.
|
|
- bool OptForSize = DAG.getMachineFunction().getFunction().optForSize();
|
|
|
|
|
|
+ bool OptForSize = DAG.getMachineFunction().getFunction().hasOptSize();
|
|
if (!OptForSize) {
|
|
if (!OptForSize) {
|
|
if (SDValue Masked = lowerShuffleAsBitMask(DL, VT, V1, V2, Mask, Zeroable,
|
|
if (SDValue Masked = lowerShuffleAsBitMask(DL, VT, V1, V2, Mask, Zeroable,
|
|
Subtarget, DAG))
|
|
Subtarget, DAG))
|
|
@@ -16982,7 +16982,7 @@ SDValue X86TargetLowering::LowerINSERT_VECTOR_ELT(SDValue Op,
|
|
// Bits [3:0] of the constant are the zero mask. The DAG Combiner may
|
|
// Bits [3:0] of the constant are the zero mask. The DAG Combiner may
|
|
// combine either bitwise AND or insert of float 0.0 to set these bits.
|
|
// combine either bitwise AND or insert of float 0.0 to set these bits.
|
|
|
|
|
|
- bool MinSize = DAG.getMachineFunction().getFunction().optForMinSize();
|
|
|
|
|
|
+ bool MinSize = DAG.getMachineFunction().getFunction().hasMinSize();
|
|
if (IdxVal == 0 && (!MinSize || !MayFoldLoad(N1))) {
|
|
if (IdxVal == 0 && (!MinSize || !MayFoldLoad(N1))) {
|
|
// If this is an insertion of 32-bits into the low 32-bits of
|
|
// If this is an insertion of 32-bits into the low 32-bits of
|
|
// a vector, we prefer to generate a blend with immediate rather
|
|
// a vector, we prefer to generate a blend with immediate rather
|
|
@@ -17636,7 +17636,7 @@ static SDValue LowerFunnelShift(SDValue Op, const X86Subtarget &Subtarget,
|
|
"Unexpected funnel shift type!");
|
|
"Unexpected funnel shift type!");
|
|
|
|
|
|
// Expand slow SHLD/SHRD cases if we are not optimizing for size.
|
|
// Expand slow SHLD/SHRD cases if we are not optimizing for size.
|
|
- bool OptForSize = DAG.getMachineFunction().getFunction().optForSize();
|
|
|
|
|
|
+ bool OptForSize = DAG.getMachineFunction().getFunction().hasOptSize();
|
|
if (!OptForSize && Subtarget.isSHLDSlow())
|
|
if (!OptForSize && Subtarget.isSHLDSlow())
|
|
return SDValue();
|
|
return SDValue();
|
|
|
|
|
|
@@ -18895,7 +18895,7 @@ static SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) {
|
|
/// implementation, and likely shuffle complexity of the alternate sequence.
|
|
/// implementation, and likely shuffle complexity of the alternate sequence.
|
|
static bool shouldUseHorizontalOp(bool IsSingleSource, SelectionDAG &DAG,
|
|
static bool shouldUseHorizontalOp(bool IsSingleSource, SelectionDAG &DAG,
|
|
const X86Subtarget &Subtarget) {
|
|
const X86Subtarget &Subtarget) {
|
|
- bool IsOptimizingSize = DAG.getMachineFunction().getFunction().optForSize();
|
|
|
|
|
|
+ bool IsOptimizingSize = DAG.getMachineFunction().getFunction().hasOptSize();
|
|
bool HasFastHOps = Subtarget.hasFastHorizontalOps();
|
|
bool HasFastHOps = Subtarget.hasFastHorizontalOps();
|
|
return !IsSingleSource || IsOptimizingSize || HasFastHOps;
|
|
return !IsSingleSource || IsOptimizingSize || HasFastHOps;
|
|
}
|
|
}
|
|
@@ -19376,7 +19376,7 @@ SDValue X86TargetLowering::EmitCmp(SDValue Op0, SDValue Op1, unsigned X86CC,
|
|
!cast<ConstantSDNode>(Op0)->getAPIntValue().isSignedIntN(8)) ||
|
|
!cast<ConstantSDNode>(Op0)->getAPIntValue().isSignedIntN(8)) ||
|
|
(isa<ConstantSDNode>(Op1) &&
|
|
(isa<ConstantSDNode>(Op1) &&
|
|
!cast<ConstantSDNode>(Op1)->getAPIntValue().isSignedIntN(8))) &&
|
|
!cast<ConstantSDNode>(Op1)->getAPIntValue().isSignedIntN(8))) &&
|
|
- !DAG.getMachineFunction().getFunction().optForMinSize() &&
|
|
|
|
|
|
+ !DAG.getMachineFunction().getFunction().hasMinSize() &&
|
|
!Subtarget.isAtom()) {
|
|
!Subtarget.isAtom()) {
|
|
unsigned ExtendOp =
|
|
unsigned ExtendOp =
|
|
isX86CCUnsigned(X86CC) ? ISD::ZERO_EXTEND : ISD::SIGN_EXTEND;
|
|
isX86CCUnsigned(X86CC) ? ISD::ZERO_EXTEND : ISD::SIGN_EXTEND;
|
|
@@ -19550,7 +19550,7 @@ static SDValue LowerAndToBT(SDValue And, ISD::CondCode CC,
|
|
} else {
|
|
} else {
|
|
// Use BT if the immediate can't be encoded in a TEST instruction or we
|
|
// Use BT if the immediate can't be encoded in a TEST instruction or we
|
|
// are optimizing for size and the immedaite won't fit in a byte.
|
|
// are optimizing for size and the immedaite won't fit in a byte.
|
|
- bool OptForSize = DAG.getMachineFunction().getFunction().optForSize();
|
|
|
|
|
|
+ bool OptForSize = DAG.getMachineFunction().getFunction().hasOptSize();
|
|
if ((!isUInt<32>(AndRHSVal) || (OptForSize && !isUInt<8>(AndRHSVal))) &&
|
|
if ((!isUInt<32>(AndRHSVal) || (OptForSize && !isUInt<8>(AndRHSVal))) &&
|
|
isPowerOf2_64(AndRHSVal)) {
|
|
isPowerOf2_64(AndRHSVal)) {
|
|
Src = AndLHS;
|
|
Src = AndLHS;
|
|
@@ -35932,7 +35932,7 @@ static SDValue reduceVMULWidth(SDNode *N, SelectionDAG &DAG,
|
|
// pmulld is supported since SSE41. It is better to use pmulld
|
|
// pmulld is supported since SSE41. It is better to use pmulld
|
|
// instead of pmullw+pmulhw, except for subtargets where pmulld is slower than
|
|
// instead of pmullw+pmulhw, except for subtargets where pmulld is slower than
|
|
// the expansion.
|
|
// the expansion.
|
|
- bool OptForMinSize = DAG.getMachineFunction().getFunction().optForMinSize();
|
|
|
|
|
|
+ bool OptForMinSize = DAG.getMachineFunction().getFunction().hasMinSize();
|
|
if (Subtarget.hasSSE41() && (OptForMinSize || !Subtarget.isPMULLDSlow()))
|
|
if (Subtarget.hasSSE41() && (OptForMinSize || !Subtarget.isPMULLDSlow()))
|
|
return SDValue();
|
|
return SDValue();
|
|
|
|
|
|
@@ -36240,7 +36240,7 @@ static SDValue combineMul(SDNode *N, SelectionDAG &DAG,
|
|
if (!MulConstantOptimization)
|
|
if (!MulConstantOptimization)
|
|
return SDValue();
|
|
return SDValue();
|
|
// An imul is usually smaller than the alternative sequence.
|
|
// An imul is usually smaller than the alternative sequence.
|
|
- if (DAG.getMachineFunction().getFunction().optForMinSize())
|
|
|
|
|
|
+ if (DAG.getMachineFunction().getFunction().hasMinSize())
|
|
return SDValue();
|
|
return SDValue();
|
|
|
|
|
|
if (DCI.isBeforeLegalize() || DCI.isCalledByLegalizer())
|
|
if (DCI.isBeforeLegalize() || DCI.isCalledByLegalizer())
|
|
@@ -37659,7 +37659,7 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG,
|
|
return SDValue();
|
|
return SDValue();
|
|
|
|
|
|
// fold (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
|
|
// fold (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c)
|
|
- bool OptForSize = DAG.getMachineFunction().getFunction().optForSize();
|
|
|
|
|
|
+ bool OptForSize = DAG.getMachineFunction().getFunction().hasOptSize();
|
|
unsigned Bits = VT.getScalarSizeInBits();
|
|
unsigned Bits = VT.getScalarSizeInBits();
|
|
|
|
|
|
// SHLD/SHRD instructions have lower register pressure, but on some
|
|
// SHLD/SHRD instructions have lower register pressure, but on some
|
|
@@ -39938,7 +39938,7 @@ static SDValue combineFMinNumFMaxNum(SDNode *N, SelectionDAG &DAG,
|
|
|
|
|
|
// If we have to respect NaN inputs, this takes at least 3 instructions.
|
|
// If we have to respect NaN inputs, this takes at least 3 instructions.
|
|
// Favor a library call when operating on a scalar and minimizing code size.
|
|
// Favor a library call when operating on a scalar and minimizing code size.
|
|
- if (!VT.isVector() && DAG.getMachineFunction().getFunction().optForMinSize())
|
|
|
|
|
|
+ if (!VT.isVector() && DAG.getMachineFunction().getFunction().hasMinSize())
|
|
return SDValue();
|
|
return SDValue();
|
|
|
|
|
|
EVT SetCCType = TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(),
|
|
EVT SetCCType = TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(),
|