[llvm] ce87133 - [llvm][IPO] Inclusive language: Rename mergefunc-sanity to mergefunc-verify and remove other instances of sanity in MergeFunctions.cpp
Zarko Todorovski via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 18 08:50:12 PDT 2022
Author: Zarko Todorovski
Date: 2022-04-18T11:50:08-04:00
New Revision: ce87133120685cc61b60fe3f1545cbbfdaa59805
URL: https://github.com/llvm/llvm-project/commit/ce87133120685cc61b60fe3f1545cbbfdaa59805
DIFF: https://github.com/llvm/llvm-project/commit/ce87133120685cc61b60fe3f1545cbbfdaa59805.diff
LOG: [llvm][IPO] Inclusive language: Rename mergefunc-sanity to mergefunc-verify and remove other instances of sanity in MergeFunctions.cpp
This patch renames the mergefunc-sanity to mergefunc-verify and renames the related functions to use more
inclusive language
Reviewed By: cebowleratibm
Differential Revision: https://reviews.llvm.org/D114374
Added:
Modified:
llvm/lib/Transforms/IPO/MergeFunctions.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index 0bfb8f424c3c7..2c35dd6c125bb 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -136,10 +136,10 @@ STATISTIC(NumThunksWritten, "Number of thunks generated");
STATISTIC(NumAliasesWritten, "Number of aliases generated");
STATISTIC(NumDoubleWeak, "Number of new functions created");
-static cl::opt<unsigned> NumFunctionsForSanityCheck(
- "mergefunc-sanity",
- cl::desc("How many functions in module could be used for "
- "MergeFunctions pass sanity check. "
+static cl::opt<unsigned> NumFunctionsForVerificationCheck(
+ "mergefunc-verify",
+ cl::desc("How many functions in a module could be used for "
+ "MergeFunctions to pass a basic correctness check. "
"'0' disables this check. Works only with '-debug' key."),
cl::init(0), cl::Hidden);
@@ -227,8 +227,8 @@ class MergeFunctions {
#ifndef NDEBUG
/// Checks the rules of order relation introduced among functions set.
- /// Returns true, if sanity check has been passed, and false if failed.
- bool doSanityCheck(std::vector<WeakTrackingVH> &Worklist);
+ /// Returns true, if check has been passed, and false if failed.
+ bool doFunctionalCheck(std::vector<WeakTrackingVH> &Worklist);
#endif
/// Insert a ComparableFunction into the FnTree, or merge it away if it's
@@ -327,12 +327,12 @@ PreservedAnalyses MergeFunctionsPass::run(Module &M,
}
#ifndef NDEBUG
-bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
- if (const unsigned Max = NumFunctionsForSanityCheck) {
+bool MergeFunctions::doFunctionalCheck(std::vector<WeakTrackingVH> &Worklist) {
+ if (const unsigned Max = NumFunctionsForVerificationCheck) {
unsigned TripleNumber = 0;
bool Valid = true;
- dbgs() << "MERGEFUNC-SANITY: Started for first " << Max << " functions.\n";
+ dbgs() << "MERGEFUNC-VERIFY: Started for first " << Max << " functions.\n";
unsigned i = 0;
for (std::vector<WeakTrackingVH>::iterator I = Worklist.begin(),
@@ -348,7 +348,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
// If F1 <= F2, then F2 >= F1, otherwise report failure.
if (Res1 != -Res2) {
- dbgs() << "MERGEFUNC-SANITY: Non-symmetric; triple: " << TripleNumber
+ dbgs() << "MERGEFUNC-VERIFY: Non-symmetric; triple: " << TripleNumber
<< "\n";
dbgs() << *F1 << '\n' << *F2 << '\n';
Valid = false;
@@ -381,7 +381,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
}
if (!Transitive) {
- dbgs() << "MERGEFUNC-SANITY: Non-transitive; triple: "
+ dbgs() << "MERGEFUNC-VERIFY: Non-transitive; triple: "
<< TripleNumber << "\n";
dbgs() << "Res1, Res3, Res4: " << Res1 << ", " << Res3 << ", "
<< Res4 << "\n";
@@ -392,7 +392,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
}
}
- dbgs() << "MERGEFUNC-SANITY: " << (Valid ? "Passed." : "Failed.") << "\n";
+ dbgs() << "MERGEFUNC-VERIFY: " << (Valid ? "Passed." : "Failed.") << "\n";
return Valid;
}
return true;
@@ -433,7 +433,7 @@ bool MergeFunctions::runOnModule(Module &M) {
std::vector<WeakTrackingVH> Worklist;
Deferred.swap(Worklist);
- LLVM_DEBUG(doSanityCheck(Worklist));
+ LLVM_DEBUG(doFunctionalCheck(Worklist));
LLVM_DEBUG(dbgs() << "size of module: " << M.size() << '\n');
LLVM_DEBUG(dbgs() << "size of worklist: " << Worklist.size() << '\n');
More information about the llvm-commits
mailing list