summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAiden Grossman <aidengrossman@google.com>2025-11-22 07:37:20 +0000
committerAiden Grossman <aidengrossman@google.com>2025-11-22 07:37:20 +0000
commitad7a5d4e059741819baa1561bfd9bc98d29260f3 (patch)
tree943a485c6dfa334086b285e8a144418fd7195790
parent226765b60cc54e03386f38874a177c906f5aa6e7 (diff)
[CallBrPrepare] Prefer Function &F over Function &Fn
Function &F is the more standard abbreviation (~4000 uses in llvm versus ~300 uses).
-rw-r--r--llvm/include/llvm/CodeGen/CallBrPrepare.h2
-rw-r--r--llvm/lib/CodeGen/CallBrPrepare.cpp20
2 files changed, 11 insertions, 11 deletions
diff --git a/llvm/include/llvm/CodeGen/CallBrPrepare.h b/llvm/include/llvm/CodeGen/CallBrPrepare.h
index 989343b02d02..d44d30b0adc1 100644
--- a/llvm/include/llvm/CodeGen/CallBrPrepare.h
+++ b/llvm/include/llvm/CodeGen/CallBrPrepare.h
@@ -15,7 +15,7 @@ namespace llvm {
class CallBrPreparePass : public PassInfoMixin<CallBrPreparePass> {
public:
- PreservedAnalyses run(Function &Fn, FunctionAnalysisManager &FAM);
+ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
};
} // namespace llvm
diff --git a/llvm/lib/CodeGen/CallBrPrepare.cpp b/llvm/lib/CodeGen/CallBrPrepare.cpp
index b6fe0fa00f2b..77a0d0b65387 100644
--- a/llvm/lib/CodeGen/CallBrPrepare.cpp
+++ b/llvm/lib/CodeGen/CallBrPrepare.cpp
@@ -59,7 +59,7 @@ static bool InsertIntrinsicCalls(ArrayRef<CallBrInst *> CBRs,
DominatorTree &DT);
static void UpdateSSA(DominatorTree &DT, CallBrInst *CBR, CallInst *Intrinsic,
SSAUpdater &SSAUpdate);
-static SmallVector<CallBrInst *, 2> FindCallBrs(Function &Fn);
+static SmallVector<CallBrInst *, 2> FindCallBrs(Function &F);
namespace {
@@ -67,21 +67,21 @@ class CallBrPrepare : public FunctionPass {
public:
CallBrPrepare() : FunctionPass(ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const override;
- bool runOnFunction(Function &Fn) override;
+ bool runOnFunction(Function &F) override;
static char ID;
};
} // end anonymous namespace
-PreservedAnalyses CallBrPreparePass::run(Function &Fn,
+PreservedAnalyses CallBrPreparePass::run(Function &F,
FunctionAnalysisManager &FAM) {
bool Changed = false;
- SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(Fn);
+ SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(F);
if (CBRs.empty())
return PreservedAnalyses::all();
- auto &DT = FAM.getResult<DominatorTreeAnalysis>(Fn);
+ auto &DT = FAM.getResult<DominatorTreeAnalysis>(F);
Changed |= SplitCriticalEdges(CBRs, DT);
Changed |= InsertIntrinsicCalls(CBRs, DT);
@@ -106,9 +106,9 @@ void CallBrPrepare::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<DominatorTreeWrapperPass>();
}
-SmallVector<CallBrInst *, 2> FindCallBrs(Function &Fn) {
+SmallVector<CallBrInst *, 2> FindCallBrs(Function &F) {
SmallVector<CallBrInst *, 2> CBRs;
- for (BasicBlock &BB : Fn)
+ for (BasicBlock &BB : F)
if (auto *CBR = dyn_cast<CallBrInst>(BB.getTerminator()))
if (!CBR->getType()->isVoidTy() && !CBR->use_empty())
CBRs.push_back(CBR);
@@ -219,9 +219,9 @@ void UpdateSSA(DominatorTree &DT, CallBrInst *CBR, CallInst *Intrinsic,
}
}
-bool CallBrPrepare::runOnFunction(Function &Fn) {
+bool CallBrPrepare::runOnFunction(Function &F) {
bool Changed = false;
- SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(Fn);
+ SmallVector<CallBrInst *, 2> CBRs = FindCallBrs(F);
if (CBRs.empty())
return Changed;
@@ -238,7 +238,7 @@ bool CallBrPrepare::runOnFunction(Function &Fn) {
if (auto *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>())
DT = &DTWP->getDomTree();
else {
- LazilyComputedDomTree.emplace(Fn);
+ LazilyComputedDomTree.emplace(F);
DT = &*LazilyComputedDomTree;
}