mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 21:53:12 +08:00
[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
This commit is contained in:
@@ -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 @@ private:
|
||||
|
||||
#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');
|
||||
|
||||
Reference in New Issue
Block a user