aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp
diff options
context:
space:
mode:
authorDaniel Hoekwater <hoekwater@google.com>2025-02-11 23:25:08 +0000
committerGitHub <noreply@github.com>2025-02-11 18:25:08 -0500
commit3a22cf9bd85f77b5274304eda6f90d758f0a6664 (patch)
tree0eda283d5dae6991f079ff8ec8d801560c8dc012 /llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp
parent376f65d865282d32c12f47a3247968e16025d1ef (diff)
downloadllvm-3a22cf9bd85f77b5274304eda6f90d758f0a6664.zip
llvm-3a22cf9bd85f77b5274304eda6f90d758f0a6664.tar.gz
llvm-3a22cf9bd85f77b5274304eda6f90d758f0a6664.tar.bz2
[CFIFixup] Fixup CFI for split functions with synchronous uwtables (#125299)
- **Precommit tests for synchronous uwtable CFI fixup** - **[CFIFixup] Fixup CFI for split functions with synchronous uwtables** Commit https://github.com/llvm/llvm-project/commit/6e54fccede402c9ed0e8038aa258a99c5a2773e5 disables CFI fixup for functions with synchronous tables, breaking CFI for split functions. Instead, we can disable *block-level* CFI fixup for functions with synchronous tables. Unwind tables can be: - N/A (not present) - Asynchronous - Synchronous Functions without unwind tables don't need CFI fixup (since they don't care about CFI). Functions with asynchronous unwind tables must be accurate for each basic block, so full CFI fixup is necessary. Functions with synchronous unwind tables only need to be accurate for each function (specifically, the portion of a function in a given section). Disabling CFI fixup entirely for functions with synchronous uwtables may break CFI for a function split between two sections. The portion in the first section may have valid CFI, while the portion in the second section is missing a call frame. Ex: ``` (.text.hot) Foo (BB1): <Call frame information> ... BB2: ... (.text.split) BB3: ... BB4: <epilogue> ``` Even if `Foo` has a synchronous unwind table, we still need to insert call frame information into `BB3` so that unwinding the call stack from `BB3` or `BB4` works properly.
Diffstat (limited to 'llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp b/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp
index 08e86c7..5784974 100644
--- a/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp
+++ b/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp
@@ -35,7 +35,7 @@ bool TargetFrameLowering::enableCalleeSaveSkip(const MachineFunction &MF) const
return false;
}
-bool TargetFrameLowering::enableCFIFixup(MachineFunction &MF) const {
+bool TargetFrameLowering::enableCFIFixup(const MachineFunction &MF) const {
return MF.needsFrameMoves() &&
!MF.getTarget().getMCAsmInfo()->usesWindowsCFI();
}