[PATCH] D132495: [BOLT] Verify externally referenced blocks against jump table targets
Maksim Panchenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 15 17:34:54 PDT 2022
maksfb added inline comments.
================
Comment at: bolt/include/bolt/Core/BinaryFunction.h:2108
+ /// offsets.
+ bool validateExternalReferences();
+
----------------
It's reasonable to expect for `validate...()` function to return `true` if all checks pass. Please invert the return code.
================
Comment at: bolt/lib/Core/BinaryFunction.cpp:1763
+ if (BinaryBasicBlock *BB = getBasicBlockAtOffset(Destination)) {
+ bool Found = JTTargets.contains(BB->getLabel());
+ if (Found)
----------------
Is there a reason to keep `Found` in a variable?
================
Comment at: bolt/lib/Core/BinaryFunction.cpp:1775
+ } else {
+ if (opts::Verbosity >= 1) {
+ errs() << "BOLT-WARNING: unknown data to code reference to offset "
----------------
If you don't expect this warning to be firing frequently, let's print it at default verbosity level.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132495/new/
https://reviews.llvm.org/D132495
More information about the llvm-commits
mailing list