Skip to content

M68k: Remove hasDebugInfo check when deciding to emit CFI #99750

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

Merged
merged 2 commits into from
Jul 20, 2024

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Jul 20, 2024

No other target checks this, and this is untested. I am trying
to remove the MachineModuleInfo reference from MachineFunction,
and this is the stickiest blocker.

Copy link
Contributor Author

arsenm commented Jul 20, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @arsenm and the rest of your teammates on Graphite Graphite

@llvmbot
Copy link
Member

llvmbot commented Jul 20, 2024

@llvm/pr-subscribers-backend-m68k

Author: Matt Arsenault (arsenm)

Changes

No other target checks this, and this is untested. I am trying
to remove the MachineModuleInfo reference from MachineFunction,
and this is the stickiest blocker.


Full diff: https://github.com/llvm/llvm-project/pull/99750.diff

1 Files Affected:

  • (modified) llvm/lib/Target/M68k/M68kFrameLowering.cpp (+1-2)
diff --git a/llvm/lib/Target/M68k/M68kFrameLowering.cpp b/llvm/lib/Target/M68k/M68kFrameLowering.cpp
index 36443f9d33451..a609be08d3021 100644
--- a/llvm/lib/Target/M68k/M68kFrameLowering.cpp
+++ b/llvm/lib/Target/M68k/M68kFrameLowering.cpp
@@ -246,9 +246,8 @@ MachineBasicBlock::iterator M68kFrameLowering::eliminateCallFramePseudoInstr(
     unsigned StackAlign = getStackAlignment();
     Amount = alignTo(Amount, StackAlign);
 
-    MachineModuleInfo &MMI = MF.getMMI();
     const auto &Fn = MF.getFunction();
-    bool DwarfCFI = MMI.hasDebugInfo() || Fn.needsUnwindTableEntry();
+    bool DwarfCFI = Fn.needsUnwindTableEntry();
 
     // If we have any exception handlers in this function, and we adjust
     // the SP before calls, we may need to indicate this to the unwinder

No other target checks this directly, and this is untested. Use needsFrameMoves,
which covers both conditions already and is what most other targets consider.
const auto &Fn = MF.getFunction();
bool DwarfCFI = MMI.hasDebugInfo() || Fn.needsUnwindTableEntry();
bool DwarfCFI = Fn.needsUnwindTableEntry();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe most of M68k's frame lowering was adapted from X86, and the corresponding line was changed by this commit to MF.needsFrameMoves(). I'm not sure this is the correct method to use, but at least using it would be consistent.

By the way, needsFrameMoves calls MF.getMMI(). Is there a plan on how to get rid of this call?

@arsenm arsenm force-pushed the users/arsenm/m68k-remove-mmi-hasdebuginfo-check branch from 23815a3 to 35126c1 Compare July 20, 2024 10:40
@arsenm arsenm merged commit a03935b into main Jul 20, 2024
5 of 7 checks passed
@arsenm arsenm deleted the users/arsenm/m68k-remove-mmi-hasdebuginfo-check branch July 20, 2024 11:56
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
No other target checks this, and this is untested. I am trying
to remove the MachineModuleInfo reference from MachineFunction,
and this is the stickiest blocker.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants