[all-commits] [llvm/llvm-project] 778801: [BOLT] Never call fixBranches() on non-simple func...
Maksim Panchenko via All-commits
all-commits at lists.llvm.org
Thu May 22 14:02:15 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 778801cc84399cf1cfe3d5534a911320ae9a7976
https://github.com/llvm/llvm-project/commit/778801cc84399cf1cfe3d5534a911320ae9a7976
Author: Maksim Panchenko <maks at fb.com>
Date: 2025-05-22 (Thu, 22 May 2025)
Changed paths:
M bolt/lib/Core/BinaryContext.cpp
M bolt/lib/Core/BinaryFunction.cpp
A bolt/test/X86/fix-branches-broken-cfg.s
Log Message:
-----------
[BOLT] Never call fixBranches() on non-simple functions (#141112)
We should never call fixBranches() on a function with invalid CFG. E.g.,
ValidateInternalCalls modifies CFG for its internal analysis purposes.
At the same time, it marks the function as non-simple with an assumption
that fixBranches() will never run on that function.
However, calculateEmittedSize() by default calls fixBranches() which can
lead to all sorts of issues, including assertions firing in
fixBranches().
The fix is to use the original size for non-simple functions in
calculateEmittedSize() since we are supposed to emit the function
unmodified. Additionally, add an assertion at the start of
fixBranches().
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list