Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,274
    • Issues 4,274
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 412
    • Merge Requests 412
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14226

Closed
Open
Opened Sep 13, 2017 by Ben Gamari@bgamari🐢Maintainer

Common Block Elimination pass doesn't eliminate common blocks

In #14222 it was noted that something appears to be broken in CmmCommonBlockElim. Consider the program from that ticket,

module T14221 where

import Data.Text as T

isNumeric :: Text -> Bool
isNumeric t =
    T.all isNumeric' t && T.any isNumber t
  where
    isNumber c = '0' <= c && c <= '9'
    isNumeric' c = isNumber c
                || c == 'e'
                || c == 'E'
                || c == '.'
                || c == '-'
                || c == '+'

This program produces six copies of a block of the form,

      c6JT:
          R2 = I64[R1 + 7];
          R1 = P64[Sp + 8];
          Sp = Sp + 16;
          call $wloop_all_s6CQ_info(R2, R1) args: 8, res: 0, upd: 8;

in the -ddump-opt-cmm output, which are manifest in the assembler as,

block_c6JT_info:
_c6JT:
	movq 7(%rbx),%r14
	movq 8(%rbp),%rbx
	addq $16,%rbp
	jmp $wloop_all_s6CQ_info

CBE really ought to be catching these.

Edited Mar 10, 2019 by Ben Gamari
Assignee
Assign to
9.0.1
Milestone
9.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14226