polyhedral model: fix scope of function call and reduction