[llvm-branch-commits] [Transforms][Utils] Remove ProfcheckDisableMetadataFixes checks (PR #222382)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Sep 9 09:51:52 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Aiden Grossman (boomanaiden154)
<details>
<summary>Changes</summary>
Our internal ablation study on the set of checks up to 2-11-2026 has
finished, so we can remove any fixes that are older than that.
---
Full diff: https://github.com/llvm/llvm-project/pull/222382.diff
4 Files Affected:
- (modified) llvm/lib/Transforms/Utils/LoopPeel.cpp (+1-3)
- (modified) llvm/lib/Transforms/Utils/LoopUtils.cpp (+1-4)
- (modified) llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp (-6)
- (modified) llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll (+22-39)
``````````diff
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp
index cc45a3e09bd88..315763d442786 100644
--- a/llvm/lib/Transforms/Utils/LoopPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp
@@ -90,7 +90,6 @@ static cl::opt<bool> EnablePeelingForIV(
static const char *PeeledCountMetaData = "llvm.loop.peeled.count";
-extern cl::opt<bool> ProfcheckDisableMetadataFixes;
} // namespace llvm
// Check whether we are capable of peeling this loop.
@@ -1231,8 +1230,7 @@ void llvm::peelLoop(Loop *L, unsigned PeelCount, bool PeelLast, LoopInfo *LI,
auto *BI = B.CreateCondBr(Cond, NewPreHeader, InsertTop);
SmallVector<uint32_t> Weights;
auto *OrigLatchBr = Latch->getTerminator();
- auto HasBranchWeights = !ProfcheckDisableMetadataFixes &&
- extractBranchWeights(*OrigLatchBr, Weights);
+ auto HasBranchWeights = extractBranchWeights(*OrigLatchBr, Weights);
if (HasBranchWeights) {
// The probability that the new guard skips the loop to execute just one
// iteration is the original loop's probability of exiting at the latch
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index d3f2f0beacc6a..a2e544801b9c4 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -54,9 +54,6 @@ using namespace llvm::PatternMatch;
static const char *LLVMLoopDisableNonforced = "llvm.loop.disable_nonforced";
static const char *LLVMLoopDisableLICM = "llvm.licm.disable";
-namespace llvm {
-extern cl::opt<bool> ProfcheckDisableMetadataFixes;
-} // namespace llvm
bool llvm::formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI,
MemorySSAUpdater *MSSAU,
@@ -994,7 +991,7 @@ bool llvm::setLoopEstimatedTripCount(
return true;
// Calculate taken and exit weights.
- unsigned LatchExitWeight = ProfcheckDisableMetadataFixes ? 0 : 1;
+ unsigned LatchExitWeight = 1;
unsigned BackedgeTakenWeight = 0;
if (EstimatedTripCount != 0) {
diff --git a/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp b/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
index c48e173b05479..84131f6592e50 100644
--- a/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
+++ b/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
@@ -26,10 +26,6 @@
using namespace llvm;
-namespace llvm {
-extern cl::opt<bool> ProfcheckDisableMetadataFixes;
-}
-
/// \returns \p Len urem \p OpSize, checking for optimization opportunities.
/// \p OpSizeVal must be the integer value of the \c ConstantInt \p OpSize.
static Value *getRuntimeLoopRemainder(IRBuilderBase &B, Value *Len,
@@ -71,8 +67,6 @@ struct LoopExpansionInfo {
};
std::optional<uint64_t> getAverageMemOpLoopTripCount(const MemIntrinsic &I) {
- if (ProfcheckDisableMetadataFixes)
- return std::nullopt;
if (std::optional<uint64_t> EC = I.getFunction()->getEntryCount();
!EC || *EC == 0)
return std::nullopt;
diff --git a/llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll b/llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll
index 43e2cd8dcd89c..8c9f7ce3be403 100644
--- a/llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll
+++ b/llvm/test/Transforms/LoopUnroll/branch-weights-freq/peel-last-iteration.ll
@@ -1,7 +1,4 @@
-; Disable this test in profcheck because the first run would cause profcheck to fail.
-; REQUIRES: !profcheck
-; RUN: opt -p "print<block-freq>,loop-unroll,print<block-freq>" -scev-cheap-expansion-budget=3 -S %s -profcheck-disable-metadata-fixes 2>&1 | FileCheck %s --check-prefixes=COMMON,BAD
-; RUN: opt -p "print<block-freq>,loop-unroll,print<block-freq>" -scev-cheap-expansion-budget=3 -S %s 2>&1 | FileCheck %s --check-prefixes=COMMON,GOOD
+; RUN: opt -p "print<block-freq>,loop-unroll,print<block-freq>" -scev-cheap-expansion-budget=3 -S %s 2>&1 | FileCheck %s
define i32 @test_expansion_cost_2(i32 %start, i32 %end) !prof !0 {
entry:
@@ -29,38 +26,24 @@ exit:
!1 = !{!"branch_weights", i32 2, i32 3}
!2 = !{!"branch_weights", i32 1, i32 50}
-; COMMON: block-frequency-info: test_expansion_cost_2
-; COMMON-NEXT: entry: float = 1.0
-; COMMON-NEXT: loop.header: float = 51.0
-; COMMON-NEXT: then: float = 20.4
-; COMMON-NEXT: loop.latch: float = 51.0
-; COMMON-NEXT: exit: float = 1.0
-
-; COMMON: block-frequency-info: test_expansion_cost_2
-; GOOD-NEXT: entry: float = 1.0
-; GOOD-NEXT: entry.split: float = 0.98039
-; GOOD-NEXT: loop.header: float = 50.0
-; GOOD-NEXT: then: float = 20.0
-; GOOD-NEXT: loop.latch: float = 50.0
-; GOOD-NEXT: exit.peel.begin.loopexit: float = 0.98039
-; GOOD-NEXT: exit.peel.begin: float = 1.0
-; GOOD-NEXT: loop.header.peel: float = 1.0
-; GOOD-NEXT: then.peel: float = 0.4
-; GOOD-NEXT: loop.latch.peel: float = 1.0
-; GOOD-NEXT: exit.peel.next: float = 1.0
-; GOOD-NEXT: loop.header.peel.next: float = 1.0
-; GOOD-NEXT: exit: float = 1.0
-
-; BAD-NEXT: entry: float = 1.0
-; BAD-NEXT: entry.split: float = 0.625
-; BAD-NEXT: loop.header: float = 31.875
-; BAD-NEXT: then: float = 12.75
-; BAD-NEXT: loop.latch: float = 31.875
-; BAD-NEXT: exit.peel.begin.loopexit: float = 0.625
-; BAD-NEXT: exit.peel.begin: float = 1.0
-; BAD-NEXT: loop.header.peel: float = 1.0
-; BAD-NEXT: then.peel: float = 0.4
-; BAD-NEXT: loop.latch.peel: float = 1.0
-; BAD-NEXT: exit.peel.next: float = 1.0
-; BAD-NEXT: loop.header.peel.next: float = 1.0
-; BAD-NEXT: exit: float = 1.0
\ No newline at end of file
+; CHECK: block-frequency-info: test_expansion_cost_2
+; CHECK-NEXT: entry: float = 1.0
+; CHECK-NEXT: loop.header: float = 51.0
+; CHECK-NEXT: then: float = 20.4
+; CHECK-NEXT: loop.latch: float = 51.0
+; CHECK-NEXT: exit: float = 1.0
+
+; CHECK: block-frequency-info: test_expansion_cost_2
+; CHECK-NEXT: entry: float = 1.0
+; CHECK-NEXT: entry.split: float = 0.98039
+; CHECK-NEXT: loop.header: float = 50.0
+; CHECK-NEXT: then: float = 20.0
+; CHECK-NEXT: loop.latch: float = 50.0
+; CHECK-NEXT: exit.peel.begin.loopexit: float = 0.98039
+; CHECK-NEXT: exit.peel.begin: float = 1.0
+; CHECK-NEXT: loop.header.peel: float = 1.0
+; CHECK-NEXT: then.peel: float = 0.4
+; CHECK-NEXT: loop.latch.peel: float = 1.0
+; CHECK-NEXT: exit.peel.next: float = 1.0
+; CHECK-NEXT: loop.header.peel.next: float = 1.0
+; CHECK-NEXT: exit: float = 1.0
\ No newline at end of file
``````````
</details>
https://github.com/llvm/llvm-project/pull/222382
More information about the llvm-branch-commits
mailing list