{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/2463","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/2463/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/2463/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/2463/events","html_url":"https://github.com/chapel-lang/chapel/pull/2463","id":105530806,"number":2463,"title":"Trigger fast followers for promoted expressions","user":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chapel-lang/chapel/labels/post%201.12%20release","name":"post 1.12 release","color":"bfdadc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-09T06:40:08Z","updated_at":"2015-11-10T19:23:30Z","closed_at":"2015-11-10T19:23:30Z","pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/2463","html_url":"https://github.com/chapel-lang/chapel/pull/2463","diff_url":"https://github.com/chapel-lang/chapel/pull/2463.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/2463.patch"},"body":"In order for fast followers to trigger the `chpl__staticFastFollowCheck` and\r\n`chpl__dynamicFastFollowCheck` functions must be implemented for the follower\r\ntypes. For promoted expressions the type is an iterator record which did not\r\nhave the above functions.\r\n\r\nWe needed some way to get the fields of an iterator record in order to check if\r\nthey were candidates for fast followers. This commit basically creates a tuple\r\nthat contains each value of an iterator record and calls the corresponding fast\r\nfollower check on that tuple. In other words we try to convert the iterator\r\nrecord to a tuple since we already have fast follower check functions for\r\ntuples.\r\n\r\nHowever, when promotion wrappers are created during function resolution the\r\niterator record is empty and will only be filled in during iterator inlining. To\r\nget around this a new primitive (PRIM_ITERATOR_RECORD_FIELD_VALUE_BY_FORMAL) was\r\nintroduced. The primitive takes an iterator record and the formal that will\r\nlater be transformed into a field. The formal is used to determine the type.\r\nDuring iterator inlining the iterator records fields are finally added, one\r\nfor each formal of the wrapper iterator. At this time, we now replace out\r\nprimitive with a PRIM_GET_MEMBER_VALUE and replace the formal with the iterator\r\nrecord's field.\r\n\r\nThe end result is that we're able to use fast followers for promoted\r\nexpressions. This gets us the same performance for promoted version of stream\r\nas we get for the global version.\r\n\r\nI still have some cleanup to do and some tests to add, but I'm ran out of time\r\nfor feature freeze, so that'll have to wait until code freeze."},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/155538335","html_url":"https://github.com/chapel-lang/chapel/pull/2463#issuecomment-155538335","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/2463","id":155538335,"user":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T19:23:30Z","updated_at":"2015-11-10T19:23:30Z","body":"Closing this since it still has a few regressions (and it's been open for too long), will re-open once they have been addressed"}}