{"action":"closed","number":5229,"pull_request":{"url":"https://api.github.com/repos/dlang/dmd/pulls/5229","id":48647970,"html_url":"https://github.com/dlang/dmd/pull/5229","diff_url":"https://github.com/dlang/dmd/pull/5229.diff","patch_url":"https://github.com/dlang/dmd/pull/5229.patch","issue_url":"https://api.github.com/repos/dlang/dmd/issues/5229","number":5229,"state":"closed","locked":false,"title":"Add VRP-based constant folding for integer comparisons.","user":{"login":"tsbockman","id":1332026,"avatar_url":"https://avatars0.githubusercontent.com/u/1332026?v=3","gravatar_id":"","url":"https://api.github.com/users/tsbockman","html_url":"https://github.com/tsbockman","followers_url":"https://api.github.com/users/tsbockman/followers","following_url":"https://api.github.com/users/tsbockman/following{/other_user}","gists_url":"https://api.github.com/users/tsbockman/gists{/gist_id}","starred_url":"https://api.github.com/users/tsbockman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsbockman/subscriptions","organizations_url":"https://api.github.com/users/tsbockman/orgs","repos_url":"https://api.github.com/users/tsbockman/repos","events_url":"https://api.github.com/users/tsbockman/events{/privacy}","received_events_url":"https://api.github.com/users/tsbockman/received_events","type":"User","site_admin":false},"body":"This is the first instalment of my translated and improved rendition of @lionello 's [PR #1913](https://github.com/D-Programming-Language/dmd/pull/1913), which I have decided to break up into chunks, since it makes several changes which do not need to be evaluated on an all-or-nothing basis.\n\nThis first piece:\n1. Implements value-range-propagation based constant folding for integer comparisons.\n2. Fixes [issue 15585](https://issues.dlang.org/show_bug.cgi?id=15585) by raising the initial VRP maximum for `dchar` values from `dchar.max` to `uint.max`.\n3. Disables the `statement is not reachable` warning. That warning interacts very badly with effective VRP in generic code ([DMD issue #14835](https://issues.dlang.org/show_bug.cgi?id=14835)), and when I made a forum thread to discuss the issue, the conclusion was that a true fix is not feasible.\n\nStrategically, my goal is to enhance VRP and constant folding capabilities to the point that [issue 259](https://issues.dlang.org/show_bug.cgi?id=259)'s pre-approved solution to the problem of dangerous signed/unsigned comparisons can be implemented without causing too many \"false positive\" errors.\n\nThis PR does not accomplish that goal by itself, but it is a useful step. In the mean time, it modestly improve the front-end's ability to optimize logic and detect unreachable code.\n\nThe change to `dchar`'s initial VRP maximum is required to prevent the compiler from treating attempts to handle invalid out-of-range `dchar` values as dead code. I got @WalterBright 's approval for this part earlier on the forums: http://forum.dlang.org/post/oionrfexehapzicgpbrw@forum.dlang.org\n","created_at":"2015-10-24T03:43:03Z","updated_at":"2017-05-23T02:52:07Z","closed_at":"2017-05-23T02:52:07Z","merged_at":null,"merge_commit_sha":"2c43942116c4dc4fd973fd1734930145d4ca3a48","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dlang/dmd/pulls/5229/commits","review_comments_url":"https://api.github.com/repos/dlang/dmd/pulls/5229/comments","review_comment_url":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/dmd/issues/5229/comments","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/2614955bd6c8d3b96220ced8589b2503d80d966f","head":{"label":"tsbockman:constfold_cmp","ref":"constfold_cmp","sha":"2614955bd6c8d3b96220ced8589b2503d80d966f","user":{"login":"tsbockman","id":1332026,"avatar_url":"https://avatars0.githubusercontent.com/u/1332026?v=3","gravatar_id":"","url":"https://api.github.com/users/tsbockman","html_url":"https://github.com/tsbockman","followers_url":"https://api.github.com/users/tsbockman/followers","following_url":"https://api.github.com/users/tsbockman/following{/other_user}","gists_url":"https://api.github.com/users/tsbockman/gists{/gist_id}","starred_url":"https://api.github.com/users/tsbockman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsbockman/subscriptions","organizations_url":"https://api.github.com/users/tsbockman/orgs","repos_url":"https://api.github.com/users/tsbockman/repos","events_url":"https://api.github.com/users/tsbockman/events{/privacy}","received_events_url":"https://api.github.com/users/tsbockman/received_events","type":"User","site_admin":false},"repo":{"id":44553656,"name":"dmd","full_name":"tsbockman/dmd","owner":{"login":"tsbockman","id":1332026,"avatar_url":"https://avatars0.githubusercontent.com/u/1332026?v=3","gravatar_id":"","url":"https://api.github.com/users/tsbockman","html_url":"https://github.com/tsbockman","followers_url":"https://api.github.com/users/tsbockman/followers","following_url":"https://api.github.com/users/tsbockman/following{/other_user}","gists_url":"https://api.github.com/users/tsbockman/gists{/gist_id}","starred_url":"https://api.github.com/users/tsbockman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsbockman/subscriptions","organizations_url":"https://api.github.com/users/tsbockman/orgs","repos_url":"https://api.github.com/users/tsbockman/repos","events_url":"https://api.github.com/users/tsbockman/events{/privacy}","received_events_url":"https://api.github.com/users/tsbockman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tsbockman/dmd","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/tsbockman/dmd","forks_url":"https://api.github.com/repos/tsbockman/dmd/forks","keys_url":"https://api.github.com/repos/tsbockman/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tsbockman/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tsbockman/dmd/teams","hooks_url":"https://api.github.com/repos/tsbockman/dmd/hooks","issue_events_url":"https://api.github.com/repos/tsbockman/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/tsbockman/dmd/events","assignees_url":"https://api.github.com/repos/tsbockman/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/tsbockman/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/tsbockman/dmd/tags","blobs_url":"https://api.github.com/repos/tsbockman/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tsbockman/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tsbockman/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/tsbockman/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tsbockman/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/tsbockman/dmd/languages","stargazers_url":"https://api.github.com/repos/tsbockman/dmd/stargazers","contributors_url":"https://api.github.com/repos/tsbockman/dmd/contributors","subscribers_url":"https://api.github.com/repos/tsbockman/dmd/subscribers","subscription_url":"https://api.github.com/repos/tsbockman/dmd/subscription","commits_url":"https://api.github.com/repos/tsbockman/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/tsbockman/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/tsbockman/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/tsbockman/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/tsbockman/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/tsbockman/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tsbockman/dmd/merges","archive_url":"https://api.github.com/repos/tsbockman/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tsbockman/dmd/downloads","issues_url":"https://api.github.com/repos/tsbockman/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/tsbockman/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/tsbockman/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/tsbockman/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tsbockman/dmd/labels{/name}","releases_url":"https://api.github.com/repos/tsbockman/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/tsbockman/dmd/deployments","created_at":"2015-10-19T18:05:01Z","updated_at":"2015-10-19T18:05:18Z","pushed_at":"2017-05-19T19:56:49Z","git_url":"git://github.com/tsbockman/dmd.git","ssh_url":"git@github.com:tsbockman/dmd.git","clone_url":"https://github.com/tsbockman/dmd.git","svn_url":"https://github.com/tsbockman/dmd","homepage":"dlang.org","size":71000,"stargazers_count":0,"watchers_count":0,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dlang:master","ref":"master","sha":"a05d1b2341d1cb5cd81c24ae63957edfb6957a92","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars0.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"dlang/dmd","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars0.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/dlang/dmd","forks_url":"https://api.github.com/repos/dlang/dmd/forks","keys_url":"https://api.github.com/repos/dlang/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/dmd/teams","hooks_url":"https://api.github.com/repos/dlang/dmd/hooks","issue_events_url":"https://api.github.com/repos/dlang/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/dmd/events","assignees_url":"https://api.github.com/repos/dlang/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/dmd/tags","blobs_url":"https://api.github.com/repos/dlang/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/dmd/languages","stargazers_url":"https://api.github.com/repos/dlang/dmd/stargazers","contributors_url":"https://api.github.com/repos/dlang/dmd/contributors","subscribers_url":"https://api.github.com/repos/dlang/dmd/subscribers","subscription_url":"https://api.github.com/repos/dlang/dmd/subscription","commits_url":"https://api.github.com/repos/dlang/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/dmd/merges","archive_url":"https://api.github.com/repos/dlang/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/dmd/downloads","issues_url":"https://api.github.com/repos/dlang/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/dmd/labels{/name}","releases_url":"https://api.github.com/repos/dlang/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/dmd/deployments","created_at":"2011-01-15T06:53:53Z","updated_at":"2017-05-22T09:27:28Z","pushed_at":"2017-05-23T02:40:38Z","git_url":"git://github.com/dlang/dmd.git","ssh_url":"git@github.com:dlang/dmd.git","clone_url":"https://github.com/dlang/dmd.git","svn_url":"https://github.com/dlang/dmd","homepage":"dlang.org","size":72250,"stargazers_count":1586,"watchers_count":1586,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":411,"mirror_url":null,"open_issues_count":168,"forks":411,"open_issues":168,"watchers":1586,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5229"},"html":{"href":"https://github.com/dlang/dmd/pull/5229"},"issue":{"href":"https://api.github.com/repos/dlang/dmd/issues/5229"},"comments":{"href":"https://api.github.com/repos/dlang/dmd/issues/5229/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5229/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/dmd/pulls/5229/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/dmd/statuses/2614955bd6c8d3b96220ced8589b2503d80d966f"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":34,"review_comments":5,"maintainer_can_modify":false,"commits":3,"additions":141,"deletions":112,"changed_files":6}}
{"actor":{"display_login":"tsbockman"}}