{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/203547697","pull_request_review_id":138460898,"id":203547697,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzU0NzY5Nw==","diff_hunk":"@@ -5711,34 +5711,76 @@ bool Compiler::optNarrowTree(GenTree* tree, var_types srct, var_types dstt, Valu\n         switch (tree->gtOper)\n         {\n             case GT_AND:\n+                noway_assert(genActualType(tree->gtType) == genActualType(op1->gtType));\n                 noway_assert(genActualType(tree->gtType) == genActualType(op2->gtType));\n \n-                // Is op2 a small constant than can be narrowed into dstt?\n-                // if so the result of the GT_AND will also fit into 'dstt' and can be narrowed\n-                if ((op2->gtOper == GT_CNS_INT) && optNarrowTree(op2, srct, dstt, NoVNPair, false))\n+                GenTree* opToNarrow;\n+                opToNarrow = nullptr;\n+                GenTree** otherOpPtr;\n+                otherOpPtr = nullptr;\n+                bool canNotNarrowOperand;","path":"src/jit/optimizer.cpp","position":14,"original_position":14,"commit_id":"8075bf6b394cd4c8aac4ef0d291099df529fb317","original_commit_id":"8075bf6b394cd4c8aac4ef0d291099df529fb317","user":{"login":"CarolEidt","id":2973870,"node_id":"MDQ6VXNlcjI5NzM4NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/2973870?v=4","gravatar_id":"","url":"https://api.github.com/users/CarolEidt","html_url":"https://github.com/CarolEidt","followers_url":"https://api.github.com/users/CarolEidt/followers","following_url":"https://api.github.com/users/CarolEidt/following{/other_user}","gists_url":"https://api.github.com/users/CarolEidt/gists{/gist_id}","starred_url":"https://api.github.com/users/CarolEidt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarolEidt/subscriptions","organizations_url":"https://api.github.com/users/CarolEidt/orgs","repos_url":"https://api.github.com/users/CarolEidt/repos","events_url":"https://api.github.com/users/CarolEidt/events{/privacy}","received_events_url":"https://api.github.com/users/CarolEidt/received_events","type":"User","site_admin":false},"body":"Could you change this to `canNarrowOperand`? Boolean values with negative names are generally confusing.","created_at":"2018-07-18T22:17:20Z","updated_at":"2018-07-18T22:18:48Z","html_url":"https://github.com/dotnet/coreclr/pull/18995#discussion_r203547697","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/18995","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/203547697"},"html":{"href":"https://github.com/dotnet/coreclr/pull/18995#discussion_r203547697"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/18995"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/18995","id":202362671,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMzYyNjcx","html_url":"https://github.com/dotnet/coreclr/pull/18995","diff_url":"https://github.com/dotnet/coreclr/pull/18995.diff","patch_url":"https://github.com/dotnet/coreclr/pull/18995.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/18995","number":18995,"state":"open","locked":false,"title":"Improve narrowing of GT_AND nodes.","user":{"login":"erozenfeld","id":10624223,"node_id":"MDQ6VXNlcjEwNjI0MjIz","avatar_url":"https://avatars2.githubusercontent.com/u/10624223?v=4","gravatar_id":"","url":"https://api.github.com/users/erozenfeld","html_url":"https://github.com/erozenfeld","followers_url":"https://api.github.com/users/erozenfeld/followers","following_url":"https://api.github.com/users/erozenfeld/following{/other_user}","gists_url":"https://api.github.com/users/erozenfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/erozenfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erozenfeld/subscriptions","organizations_url":"https://api.github.com/users/erozenfeld/orgs","repos_url":"https://api.github.com/users/erozenfeld/repos","events_url":"https://api.github.com/users/erozenfeld/events{/privacy}","received_events_url":"https://api.github.com/users/erozenfeld/received_events","type":"User","site_admin":false},"body":"#18916 was reverted because it caused failures in corefx minopts. This is a re-submission with a fix.\r\n\r\nThis is a follow-up to to #18816 which resulted in a 6 byte regression in one of the\r\ndesktop SuperPMI methods. This change removes that regression and adds a number\r\nof improved diffs.\r\n\r\nIf we are narrowing GT_AND to an unsigned type and one of the operands can be narrowed\r\ninto that type, the result of the GT_AND will also fit into that type and can be narrowed.\r\nThe same is true if one of the operands is an int const and can be narrowed into 'dsst'.\r\n\r\nThe change also ensures that we don't call optNarrowTree(false) more than once on each of the\r\nGT_AND operands.\r\n\r\n#18916 has diff numbers.","created_at":"2018-07-18T19:57:20Z","updated_at":"2018-07-18T22:18:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"376ed3686e7c9c8438f829faaf10ed8d8d73ccbb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/18995/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/18995/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/18995/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/8075bf6b394cd4c8aac4ef0d291099df529fb317","head":{"label":"erozenfeld:GT_AND_Narrowing","ref":"GT_AND_Narrowing","sha":"8075bf6b394cd4c8aac4ef0d291099df529fb317","user":{"login":"erozenfeld","id":10624223,"node_id":"MDQ6VXNlcjEwNjI0MjIz","avatar_url":"https://avatars2.githubusercontent.com/u/10624223?v=4","gravatar_id":"","url":"https://api.github.com/users/erozenfeld","html_url":"https://github.com/erozenfeld","followers_url":"https://api.github.com/users/erozenfeld/followers","following_url":"https://api.github.com/users/erozenfeld/following{/other_user}","gists_url":"https://api.github.com/users/erozenfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/erozenfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erozenfeld/subscriptions","organizations_url":"https://api.github.com/users/erozenfeld/orgs","repos_url":"https://api.github.com/users/erozenfeld/repos","events_url":"https://api.github.com/users/erozenfeld/events{/privacy}","received_events_url":"https://api.github.com/users/erozenfeld/received_events","type":"User","site_admin":false},"repo":{"id":37150968,"node_id":"MDEwOlJlcG9zaXRvcnkzNzE1MDk2OA==","name":"coreclr","full_name":"erozenfeld/coreclr","owner":{"login":"erozenfeld","id":10624223,"node_id":"MDQ6VXNlcjEwNjI0MjIz","avatar_url":"https://avatars2.githubusercontent.com/u/10624223?v=4","gravatar_id":"","url":"https://api.github.com/users/erozenfeld","html_url":"https://github.com/erozenfeld","followers_url":"https://api.github.com/users/erozenfeld/followers","following_url":"https://api.github.com/users/erozenfeld/following{/other_user}","gists_url":"https://api.github.com/users/erozenfeld/gists{/gist_id}","starred_url":"https://api.github.com/users/erozenfeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erozenfeld/subscriptions","organizations_url":"https://api.github.com/users/erozenfeld/orgs","repos_url":"https://api.github.com/users/erozenfeld/repos","events_url":"https://api.github.com/users/erozenfeld/events{/privacy}","received_events_url":"https://api.github.com/users/erozenfeld/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erozenfeld/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":true,"url":"https://api.github.com/repos/erozenfeld/coreclr","forks_url":"https://api.github.com/repos/erozenfeld/coreclr/forks","keys_url":"https://api.github.com/repos/erozenfeld/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erozenfeld/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erozenfeld/coreclr/teams","hooks_url":"https://api.github.com/repos/erozenfeld/coreclr/hooks","issue_events_url":"https://api.github.com/repos/erozenfeld/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/erozenfeld/coreclr/events","assignees_url":"https://api.github.com/repos/erozenfeld/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/erozenfeld/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/erozenfeld/coreclr/tags","blobs_url":"https://api.github.com/repos/erozenfeld/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erozenfeld/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erozenfeld/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/erozenfeld/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erozenfeld/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/erozenfeld/coreclr/languages","stargazers_url":"https://api.github.com/repos/erozenfeld/coreclr/stargazers","contributors_url":"https://api.github.com/repos/erozenfeld/coreclr/contributors","subscribers_url":"https://api.github.com/repos/erozenfeld/coreclr/subscribers","subscription_url":"https://api.github.com/repos/erozenfeld/coreclr/subscription","commits_url":"https://api.github.com/repos/erozenfeld/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/erozenfeld/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/erozenfeld/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/erozenfeld/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/erozenfeld/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/erozenfeld/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erozenfeld/coreclr/merges","archive_url":"https://api.github.com/repos/erozenfeld/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erozenfeld/coreclr/downloads","issues_url":"https://api.github.com/repos/erozenfeld/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/erozenfeld/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/erozenfeld/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/erozenfeld/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erozenfeld/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/erozenfeld/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/erozenfeld/coreclr/deployments","created_at":"2015-06-09T18:39:42Z","updated_at":"2016-06-02T01:04:42Z","pushed_at":"2018-07-18T19:54:36Z","git_url":"git://github.com/erozenfeld/coreclr.git","ssh_url":"git@github.com:erozenfeld/coreclr.git","clone_url":"https://github.com/erozenfeld/coreclr.git","svn_url":"https://github.com/erozenfeld/coreclr","homepage":"","size":228050,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"d7b079479182b0f69fafa61e8b223cd4a5e01bbb","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"node_id":"MDEwOlJlcG9zaXRvcnkzMDA5Mjg5Mw==","name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called System.Private.Corelib (or mscorlib). It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2018-07-18T21:35:25Z","pushed_at":"2018-07-18T21:35:09Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://github.com/dotnet/core","size":230170,"stargazers_count":9549,"watchers_count":9549,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2389,"mirror_url":null,"archived":false,"open_issues_count":1718,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2389,"open_issues":1718,"watchers":9549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/18995"},"html":{"href":"https://github.com/dotnet/coreclr/pull/18995"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/18995"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/18995/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/18995/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/18995/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/8075bf6b394cd4c8aac4ef0d291099df529fb317"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"CarolEidt"}}