Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,242
    • Issues 5,242
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 564
    • Merge requests 564
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !1225

WIP: Make illegal branch actually branch to unreachable in the LLVM backend

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Siddharth requested to merge bollu/ghc:2019-june-14-llvm-improve-bb-codegen into master Jun 17, 2019
  • Overview 7
  • Commits 1
  • Pipelines 1
  • Changes 1

During code generation for a CmmSwitch, if we do not have a default branch to take (switchTargetsDefault = Nothing), generate the "morally correct" LLVM IR code, where by default we branch to an unreachable basic block.

I benchmarked this (possibly incorrectly) using nofib, and saw no increase or decrease in performance.

However, I still believe this should be upstreamed since it informs the LLVM optimizer about the possible values that will be branched upon.

Feedback on making the code better is greatly appreciated :)

Edited Oct 22, 2019 by Ben Gamari
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 2019-june-14-llvm-improve-bb-codegen