Skip to content

Commit ce87133

Browse files
committed
[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
1 parent 13fc178 commit ce87133

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

llvm/lib/Transforms/IPO/MergeFunctions.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ STATISTIC(NumThunksWritten, "Number of thunks generated");
136136
STATISTIC(NumAliasesWritten, "Number of aliases generated");
137137
STATISTIC(NumDoubleWeak, "Number of new functions created");
138138

139-
static cl::opt<unsigned> NumFunctionsForSanityCheck(
140-
"mergefunc-sanity",
141-
cl::desc("How many functions in module could be used for "
142-
"MergeFunctions pass sanity check. "
139+
static cl::opt<unsigned> NumFunctionsForVerificationCheck(
140+
"mergefunc-verify",
141+
cl::desc("How many functions in a module could be used for "
142+
"MergeFunctions to pass a basic correctness check. "
143143
"'0' disables this check. Works only with '-debug' key."),
144144
cl::init(0), cl::Hidden);
145145

@@ -227,8 +227,8 @@ class MergeFunctions {
227227

228228
#ifndef NDEBUG
229229
/// Checks the rules of order relation introduced among functions set.
230-
/// Returns true, if sanity check has been passed, and false if failed.
231-
bool doSanityCheck(std::vector<WeakTrackingVH> &Worklist);
230+
/// Returns true, if check has been passed, and false if failed.
231+
bool doFunctionalCheck(std::vector<WeakTrackingVH> &Worklist);
232232
#endif
233233

234234
/// Insert a ComparableFunction into the FnTree, or merge it away if it's
@@ -327,12 +327,12 @@ PreservedAnalyses MergeFunctionsPass::run(Module &M,
327327
}
328328

329329
#ifndef NDEBUG
330-
bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
331-
if (const unsigned Max = NumFunctionsForSanityCheck) {
330+
bool MergeFunctions::doFunctionalCheck(std::vector<WeakTrackingVH> &Worklist) {
331+
if (const unsigned Max = NumFunctionsForVerificationCheck) {
332332
unsigned TripleNumber = 0;
333333
bool Valid = true;
334334

335-
dbgs() << "MERGEFUNC-SANITY: Started for first " << Max << " functions.\n";
335+
dbgs() << "MERGEFUNC-VERIFY: Started for first " << Max << " functions.\n";
336336

337337
unsigned i = 0;
338338
for (std::vector<WeakTrackingVH>::iterator I = Worklist.begin(),
@@ -348,7 +348,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
348348

349349
// If F1 <= F2, then F2 >= F1, otherwise report failure.
350350
if (Res1 != -Res2) {
351-
dbgs() << "MERGEFUNC-SANITY: Non-symmetric; triple: " << TripleNumber
351+
dbgs() << "MERGEFUNC-VERIFY: Non-symmetric; triple: " << TripleNumber
352352
<< "\n";
353353
dbgs() << *F1 << '\n' << *F2 << '\n';
354354
Valid = false;
@@ -381,7 +381,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
381381
}
382382

383383
if (!Transitive) {
384-
dbgs() << "MERGEFUNC-SANITY: Non-transitive; triple: "
384+
dbgs() << "MERGEFUNC-VERIFY: Non-transitive; triple: "
385385
<< TripleNumber << "\n";
386386
dbgs() << "Res1, Res3, Res4: " << Res1 << ", " << Res3 << ", "
387387
<< Res4 << "\n";
@@ -392,7 +392,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakTrackingVH> &Worklist) {
392392
}
393393
}
394394

395-
dbgs() << "MERGEFUNC-SANITY: " << (Valid ? "Passed." : "Failed.") << "\n";
395+
dbgs() << "MERGEFUNC-VERIFY: " << (Valid ? "Passed." : "Failed.") << "\n";
396396
return Valid;
397397
}
398398
return true;
@@ -433,7 +433,7 @@ bool MergeFunctions::runOnModule(Module &M) {
433433
std::vector<WeakTrackingVH> Worklist;
434434
Deferred.swap(Worklist);
435435

436-
LLVM_DEBUG(doSanityCheck(Worklist));
436+
LLVM_DEBUG(doFunctionalCheck(Worklist));
437437

438438
LLVM_DEBUG(dbgs() << "size of module: " << M.size() << '\n');
439439
LLVM_DEBUG(dbgs() << "size of worklist: " << Worklist.size() << '\n');

0 commit comments

Comments
 (0)