Skip to content

Commit 6b647de

Browse files
authored
[NFC] Remove the unused hasMinSize() (#133838)
The 'hasOptSize()' is 'hasFnAttribute(Attribute::OptimizeForSize) || hasMinSize()', so we don't need another 'hasMinSize()'.
1 parent 36978fa commit 6b647de

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16947,8 +16947,7 @@ bool AArch64TargetLowering::optimizeExtendOrTruncateConversion(
1694716947
// transform unless the conversion is in a loop block guaranteed to execute
1694816948
// and we are not optimizing for size.
1694916949
Function *F = I->getParent()->getParent();
16950-
if (!L || L->getHeader() != I->getParent() || F->hasMinSize() ||
16951-
F->hasOptSize())
16950+
if (!L || L->getHeader() != I->getParent() || F->hasOptSize())
1695216951
return false;
1695316952

1695416953
auto *SrcTy = dyn_cast<FixedVectorType>(I->getOperand(0)->getType());
@@ -28524,8 +28523,7 @@ bool AArch64TargetLowering::shouldLocalize(
2852428523
if (Ty.getScalarSizeInBits() != 32 && Ty.getScalarSizeInBits() != 64)
2852528524
break;
2852628525
auto APF = MI.getOperand(1).getFPImm()->getValueAPF();
28527-
bool OptForSize =
28528-
MF.getFunction().hasOptSize() || MF.getFunction().hasMinSize();
28526+
bool OptForSize = MF.getFunction().hasOptSize();
2852928527
if (isFPImmLegal(APF, EVT::getFloatingPointVT(Ty.getScalarSizeInBits()),
2853028528
OptForSize))
2853128529
return true; // Constant should be cheap.

llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ bool RISCVLegalizerInfo::legalizeCustom(
13321332
const Function &F = MF.getFunction();
13331333
// TODO: if PSI and BFI are present, add " ||
13341334
// llvm::shouldOptForSize(*CurMBB, PSI, BFI)".
1335-
bool ShouldOptForSize = F.hasOptSize() || F.hasMinSize();
1335+
bool ShouldOptForSize = F.hasOptSize();
13361336
const ConstantInt *ConstVal = MI.getOperand(1).getCImm();
13371337
if (!shouldBeInConstantPool(ConstVal->getValue(), ShouldOptForSize))
13381338
return true;

llvm/lib/Transforms/Instrumentation/PGOForceFunctionAttrs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static bool shouldRunOnFunction(Function &F, ProfileSummaryInfo &PSI,
2020
if (F.isDeclaration())
2121
return false;
2222
// Respect existing attributes.
23-
if (F.hasOptNone() || F.hasOptSize() || F.hasMinSize())
23+
if (F.hasOptNone() || F.hasOptSize())
2424
return false;
2525
if (F.hasFnAttribute(Attribute::Cold))
2626
return true;

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4729,8 +4729,7 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
47294729
return Result;
47304730
}
47314731

4732-
if (OrigLoop->getHeader()->getParent()->hasOptSize() ||
4733-
OrigLoop->getHeader()->getParent()->hasMinSize()) {
4732+
if (OrigLoop->getHeader()->getParent()->hasOptSize()) {
47344733
LLVM_DEBUG(
47354734
dbgs() << "LEV: Epilogue vectorization skipped due to opt for size.\n");
47364735
return Result;

0 commit comments

Comments
 (0)