#5256: code in an "else" branch that is never executed still does influence
runtime (Vectorizer?)
---------------------------+------------------------------------------------
  Reporter:  j.waldmann    |          Owner:                
      Type:  bug           |         Status:  closed        
  Priority:  normal        |      Milestone:                
 Component:  Compiler      |        Version:  7.0.3         
Resolution:  wontfix       |       Keywords:                
  Testcase:                |      Blockedby:                
Difficulty:                |             Os:  Linux         
  Blocking:                |   Architecture:  x86_64 (amd64)
   Failure:  None/Unknown  |  
---------------------------+------------------------------------------------
Changes (by simonpj):

  * status:  new => closed
  * resolution:  => wontfix


Comment:

 Thanks for the diagnosis Daniel; you are exactly on target I think.

 I don't think there is much we can do automatically here. Yes, foldb_cap
 has some static arguments, but SATting it would make no difference because
 the resulting function is big. What you want is ''both'' to SAT it ''and''
 to INLINE it, so that the entire fuction is specialised to its functional
 arguments at each individual call site.  If that's what you want it's
 probably easier to do it by hand.

 The one feature I can imagine being useful would be this.  Suppose you add
 INLINE to `foldb_cap` in `bug.hs`.  It won't have any effect because
 `foldl_cap` is recursive.  But GHC could treat that pragma as a clue to
 SAT the function, so that it ''can'' be inlined.

 I'm not sure though.  It seems a bit indirect and elaboate. Maybe better
 to to be explicit.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5256#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to