|
Re: [GHC] #683: RULES for recursive functions don't work properly: msg#00119lang.haskell.glasgow.bugs
#683: RULES for recursive functions don't work properly -----------------------+---------------------------------------------------- Reporter: simonpj | Owner: simonpj Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 6.4.1 Severity: normal | Resolution: Keywords: | Os: Unknown Difficulty: Unknown | Architecture: Unknown -----------------------+---------------------------------------------------- Comment (by simonpj): Before I forget, here's the beginning of a modification to address the original problem. It's not implemented, but I thought I'd leave the notes here in case it pops up as an issue again. {{{ hunk ./compiler/basicTypes/BasicTypes.lhs 329 + +Note [RulesOnly] +~~~~~~~~~~~~~~~~ +The RulesOnly boolean is True if the only reason the Id is a +loop-breaker only because of recursion through a RULE. In that case, +we can ignore the loop-breaker-ness for inlining purposes. Example +(from GHC.Enum): + + eftInt :: Int# -> Int# -> [Int] + eftInt x y = ...(non-recursive)... + + {-# INLINE [0] eftIntFB #-} + eftIntFB :: (Int -> r -> r) -> r -> Int# -> Int# -> r + eftIntFB c n x y = ...(non-recursive)... + + {-# RULES + "eftInt" [~1] forall x y. eftInt x y = build (\ c n -> eftIntFB c n x y) + "eftIntList" [1] eftIntFB (:) [] = eftInt + #-} + +The two look mutually recursive only because of their RULES; +we don't want that to inhibit inlining! + hunk ./compiler/basicTypes/BasicTypes.lhs 364 - -- in a group of recursive definitions + !RulesOnly -- in a group of recursive definitions +[_^I_][_^I_][_^I_][_$_] + +type RulesOnly = Bool -- See Note [RulesOnly] }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/683> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler_______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [GHC] #683: RULES for recursive functions don't work properly, GHC |
|---|---|
| Next by Date: | [GHC] #869: Foreign.C.String.withCStringLen doesn't terminate C string by NUL, GHC |
| Previous by Thread: | Re: [GHC] #683: RULES for recursive functions don't work properly, GHC |
| Next by Thread: | [GHC] #869: Foreign.C.String.withCStringLen doesn't terminate C string by NUL, GHC |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |