[GHC] #15104: Update JMP_TBL targets during shortcutting for x86 codegen.
#15104: Update JMP_TBL targets during shortcutting for x86 codegen. -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 (NCG) | Keywords: CodeGen | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): Phab:D4595 | Wiki Page: -------------------------------------+------------------------------------- Jump tables are generated from Cmm Code in a few steps: 1. We start with a CmmSwitch at the end of the Cmm pipeline which gets turned into a JMP_TBL instruction. 2. During native codegen we generate static jump tables from JMP_TBL. (generateJumpTables) 3. We shortcut jump targets, for jump tables by updating the static tables. (shortcutBranches). This might update the jump targets with calculated address not represented by a label. After the third step the targets in the JMP_TBL instruction (which are the original labels) and in the static data can be out of sync. Phab:D4566 went part of the way, updating labels in JMP_TBL. However without tables next to code labels can be updated to non-label jump destinations which I did not consider at the time. Phab:D4595 is intended to fix this. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15104> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15104: Update JMP_TBL targets during shortcutting for x86 codegen. -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler (NCG) | Version: 8.5 Resolution: | Keywords: CodeGen Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4595 Wiki Page: | -------------------------------------+------------------------------------- Changes (by AndreasK): * status: new => patch -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15104#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15104: Update JMP_TBL targets during shortcutting for x86 codegen. -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler (NCG) | Version: 8.5 Resolution: | Keywords: CodeGen Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4595 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"5748c79e5a7a6bd1b0bfffc514d8f4f4da92e815/ghc" 5748c79e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="5748c79e5a7a6bd1b0bfffc514d8f4f4da92e815" Change jump targets in JMP_TBL from blocks to X86.JumpDest. Jump tables always point to blocks when we first generate them. However there are rare situations where we can shortcut one of these blocks to a static address during the asm shortcutting pass. While we already updated the data section accordingly this patch also extends this to the references stored in JMP_TBL. Test Plan: ci Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #15104 Differential Revision: https://phabricator.haskell.org/D4595 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15104#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15104: Update JMP_TBL targets during shortcutting for x86 codegen. -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler (NCG) | Version: 8.5 Resolution: fixed | Keywords: CodeGen Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4595 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15104#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC