From f2175ba4baffef052e057f9ccc0eb4a12e0a6540 Mon Sep 17 00:00:00 2001 From: shining Date: Fri, 11 Apr 2025 16:35:37 +0800 Subject: [PATCH] [NFC] Use the hasMinSize() instead of hasFnAttribute(Attribute::MinSize) The other code all use the hasMinSize(), so I change the last two hasFnAttribute(Attribute::MinSize). --- llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 2 +- llvm/lib/Transforms/Scalar/JumpThreading.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp index 4b3f0e23903aa..3d8b7cbb59630 100644 --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -199,7 +199,7 @@ static bool markFunctionCold(Function &F, bool UpdateEntryCount = false) { F.addFnAttr(Attribute::Cold); Changed = true; } - if (!F.hasFnAttribute(Attribute::MinSize)) { + if (!F.hasMinSize()) { F.addFnAttr(Attribute::MinSize); Changed = true; } diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index a518e02d762f6..ba598d8415b18 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -303,7 +303,7 @@ bool JumpThreadingPass::runImpl(Function &F_, FunctionAnalysisManager *FAM_, // size. if (BBDuplicateThreshold.getNumOccurrences()) BBDupThreshold = BBDuplicateThreshold; - else if (F->hasFnAttribute(Attribute::MinSize)) + else if (F->hasMinSize()) BBDupThreshold = 3; else BBDupThreshold = DefaultBBDupThreshold;