[GHC] #991: -O option doesn't deal with par well
GHC
trac at galois.com
Mon Nov 6 11:23:39 EST 2006
#991: -O option doesn't deal with par well
------------------------------------------------+---------------------------
Reporter: shelarcy at capella.freemail.ne.jp | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.6
Severity: normal | Keywords: Parallel Haskell
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
------------------------------------------------+---------------------------
I tried to parallelize below code.
{{{
circleReg1 :: Frac -> Region
circleReg1 r (Pt x y) = x*x + y*y < r*r
}}}
I use -threaded option with dual-CPU machine. So I saw these code upgrade
performance very much.
{{{
[circleReg2] r (Pt x y) =
let x' = (x*x)
y' = y*y
r' = r*r
in
x' `par` y' `par` r' `seq` x' + y' < r'
circleReg3 r (Pt x y) =
let x' = (x*x)
y' = y*y
r' = r*r
strategy = rnf x' `par` rnf y' `par` rnf r'
in
x' + y' < r' `demanding` strategy
}}}
But ... If I want to optimise my code by ghc using -O option,
ghc notice error message like this;
circleReg2:
{{{
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ghc1572_0\ghc1572_0.hc: In function
`scmg_entry':
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ghc1572_0\ghc1572_0.hc:1102: warning:
implicit declaration of function `newSpark'
}}}
circleReg3:
{{{
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ghc980_0\ghc980_0.hc: In function
`Main_lvl_entry':
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ghc980_0\ghc980_0.hc:1097: warning:
implicit declaration of function `newSpark'
}}}
and -O option makes slower above code.
It seems that performance goes back to before parallelize, or more slowly.
I saw this error on Windows. Power PC Mac with GHC 6.4.1 doesn't cause
this problem ... but I don't test GHC 6.6 on Mac, so I don't know this bug
cause only Windows or not.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/991>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list