-
Notifications
You must be signed in to change notification settings - Fork 13.6k
llvm-tli-checker: Print custom name instead of standard name #142537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: users/arsenm/target-library-info/add-tests-of-tli-checker-output
Are you sure you want to change the base?
llvm-tli-checker: Print custom name instead of standard name #142537
Conversation
Previously this always printed the standard name if the function was available, leaving any custom name override untested. Print the target's name instead. The message should possibly include the standard name for reference.
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-llvm-analysis Author: Matt Arsenault (arsenm) ChangesPreviously this always printed the standard name if the function Full diff: https://github.com/llvm/llvm-project/pull/142537.diff 5 Files Affected:
diff --git a/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test b/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test
index 1878911ac85be..018ec131eebc9 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test
@@ -229,8 +229,8 @@ CHECK-NEXT: available: 'execve'
CHECK-NEXT: available: 'execvp'
CHECK-NEXT: available: 'execvpe'
CHECK-NEXT: available: 'exp'
-CHECK-NEXT: available: 'exp10'
-CHECK-NEXT: available: 'exp10f'
+CHECK-NEXT: available: '__exp10'
+CHECK-NEXT: available: '__exp10f'
CHECK-NEXT: not available: 'exp10l'
CHECK-NEXT: available: 'exp2'
CHECK-NEXT: available: 'exp2f'
diff --git a/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test b/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test
index 03cb8c6915331..71b731f7927cb 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test
@@ -229,8 +229,8 @@ CHECK-NEXT: available: 'execve'
CHECK-NEXT: available: 'execvp'
CHECK-NEXT: available: 'execvpe'
CHECK-NEXT: available: 'exp'
-CHECK-NEXT: available: 'exp10'
-CHECK-NEXT: available: 'exp10f'
+CHECK-NEXT: available: '__exp10'
+CHECK-NEXT: available: '__exp10f'
CHECK-NEXT: not available: 'exp10l'
CHECK-NEXT: available: 'exp2'
CHECK-NEXT: available: 'exp2f'
diff --git a/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test b/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test
index cb7b0b176905e..cfeba5fe2bbd8 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test
@@ -286,7 +286,7 @@ CHECK-NEXT: available: 'fork'
CHECK-NEXT: available: 'fprintf'
CHECK-NEXT: available: 'fputc'
CHECK-NEXT: not available: 'fputc_unlocked'
-CHECK-NEXT: available: 'fputs'
+CHECK-NEXT: available: 'fputs$UNIX2003'
CHECK-NEXT: not available: 'fputs_unlocked'
CHECK-NEXT: available: 'fread'
CHECK-NEXT: not available: 'fread_unlocked'
@@ -308,7 +308,7 @@ CHECK-NEXT: available: 'ftello'
CHECK-NEXT: not available: 'ftello64'
CHECK-NEXT: available: 'ftrylockfile'
CHECK-NEXT: available: 'funlockfile'
-CHECK-NEXT: available: 'fwrite'
+CHECK-NEXT: available: 'fwrite$UNIX2003'
CHECK-NEXT: not available: 'fwrite_unlocked'
CHECK-NEXT: available: 'getc'
CHECK-NEXT: available: 'getc_unlocked'
diff --git a/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test b/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test
index 2653cba3a0271..5ebbbd7c26415 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test
@@ -190,7 +190,7 @@ CHECK-NEXT: available: 'atoll'
CHECK-NEXT: not available: 'bcmp'
CHECK-NEXT: not available: 'bcopy'
CHECK-NEXT: not available: 'bzero'
-CHECK-NEXT: available: 'cabs'
+CHECK-NEXT: available: '_cabs'
CHECK-NEXT: not available: 'cabsf'
CHECK-NEXT: not available: 'cabsl'
CHECK-NEXT: available: 'calloc'
@@ -204,8 +204,8 @@ CHECK-NEXT: not available: 'chmod'
CHECK-NEXT: not available: 'chown'
CHECK-NEXT: available: 'clearerr'
CHECK-NEXT: not available: 'closedir'
-CHECK-NEXT: available: 'copysign'
-CHECK-NEXT: available: 'copysignf'
+CHECK-NEXT: available: '_copysign'
+CHECK-NEXT: available: '_copysignf'
CHECK-NEXT: not available: 'copysignl'
CHECK-NEXT: available: 'cos'
CHECK-NEXT: available: 'cosf'
@@ -347,8 +347,8 @@ CHECK-NEXT: not available: 'log2l'
CHECK-NEXT: not available: 'ilogb'
CHECK-NEXT: not available: 'ilogbf'
CHECK-NEXT: not available: 'ilogbl'
-CHECK-NEXT: available: 'logb'
-CHECK-NEXT: available: 'logbf'
+CHECK-NEXT: available: '_logb'
+CHECK-NEXT: available: '_logbf'
CHECK-NEXT: not available: 'logbl'
CHECK-NEXT: available: 'logf'
CHECK-NEXT: not available: 'logl'
diff --git a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
index bc20386987cae..725fe7138509d 100644
--- a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
+++ b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
@@ -131,10 +131,20 @@ static void dumpTLIEntries(const TargetLibraryInfo &TLI) {
for (unsigned FI = 0; FI != LibFunc::NumLibFuncs; ++FI) {
LibFunc LF = static_cast<LibFunc>(FI);
bool IsAvailable = TLI.has(LF);
- StringRef FuncName = TargetLibraryInfo::getStandardName(LF);
- outs() << (IsAvailable ? " " : "not ")
- << "available: " << getPrintableName(FuncName) << '\n';
+ outs() << (IsAvailable ? " " : "not ") << "available: ";
+
+ if (IsAvailable) {
+ StringRef Name = TLI.getName(LF);
+ // If there is a custom name, print it.
+ // TODO: Should we include the standard name in the printed line?
+ outs() << getPrintableName(Name);
+ } else {
+ // If it's not available, refer to it by the standard name.
+ outs() << getPrintableName(TargetLibraryInfo::getStandardName(LF));
+ }
+
+ outs() << '\n';
}
}
|
|
||
if (IsAvailable) { | ||
StringRef Name = TLI.getName(LF); | ||
// If there is a custom name, print it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If there is a custom name, print it. | |
// Print the (possibly custom) name. |
Seems reasonable, LGTM |
Previously this always printed the standard name if the function
was available, leaving any custom name override untested. Print the
target's name instead. The message should possibly include the standard
name for reference.