{"action":"created","comment":{"url":"https://api.github.com/repos/google/souper/pulls/comments/34267959","id":34267959,"diff_hunk":"@@ -146,12 +156,41 @@ bool ExprBuilder::isLoopEntryPoint(PHINode *Phi) {\n   return Loop;\n }\n \n+std::string ExprBuilder::convertToBitPattern(std::string Str, APInt One,\n+                                             APInt Zero, unsigned Width) {\n+  for (unsigned k=Width; k>0; --k) {\n+    if (Zero.getHiBits(1) == 1 && One.getHiBits(1) == 1)\n+      llvm_unreachable(\"KnownZero and KnownOnes bit can't be set to 1 together\");\n+    if (Zero.getHiBits(1) == 1) {\n+      Str.append(\"0\");\n+    } else {\n+      if (One.getHiBits(1) == 1)\n+        Str.append(\"1\");\n+      else\n+        Str.append(\"x\");\n+    }\n+    One = One.shl(1);\n+    Zero = Zero.shl(1);\n+  }\n+  Str[Width] = '\\0';\n+  return Str;\n+}\n+\n Inst *ExprBuilder::makeArrayRead(Value *V) {\n   StringRef Name;\n   if (Opts.NamedArrays)\n     Name = V->getName();\n   unsigned Width = DL.getTypeSizeInBits(V->getType());\n-  return IC.createVar(Width, Name);\n+  // Compute known bits\n+  APInt KnownZero(Width, 0), KnownOne(Width, 0);\n+  std::string ZerosPattern = \"\", OnesPattern = \"\", BitPattern = \"\";","path":"lib/Extractor/Candidates.cpp","position":61,"original_position":61,"commit_id":"d0a3e26e4951dfd53241e069c8489d7d733dc659","original_commit_id":"d0a3e26e4951dfd53241e069c8489d7d733dc659","user":{"login":"regehr","id":732536,"avatar_url":"https://avatars.githubusercontent.com/u/732536?v=3","gravatar_id":"","url":"https://api.github.com/users/regehr","html_url":"https://github.com/regehr","followers_url":"https://api.github.com/users/regehr/followers","following_url":"https://api.github.com/users/regehr/following{/other_user}","gists_url":"https://api.github.com/users/regehr/gists{/gist_id}","starred_url":"https://api.github.com/users/regehr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regehr/subscriptions","organizations_url":"https://api.github.com/users/regehr/orgs","repos_url":"https://api.github.com/users/regehr/repos","events_url":"https://api.github.com/users/regehr/events{/privacy}","received_events_url":"https://api.github.com/users/regehr/received_events","type":"User","site_admin":false},"body":"ZerosPattern and OnesPattern do not seem to be used anywhere","created_at":"2015-07-09T15:30:52Z","updated_at":"2015-07-09T15:30:52Z","html_url":"https://github.com/google/souper/pull/195#discussion_r34267959","pull_request_url":"https://api.github.com/repos/google/souper/pulls/195","_links":{"self":{"href":"https://api.github.com/repos/google/souper/pulls/comments/34267959"},"html":{"href":"https://github.com/google/souper/pull/195#discussion_r34267959"},"pull_request":{"href":"https://api.github.com/repos/google/souper/pulls/195"}}},"pull_request":{"url":"https://api.github.com/repos/google/souper/pulls/195","id":39533967,"html_url":"https://github.com/google/souper/pull/195","diff_url":"https://github.com/google/souper/pull/195.diff","patch_url":"https://github.com/google/souper/pull/195.patch","issue_url":"https://api.github.com/repos/google/souper/issues/195","number":195,"state":"open","locked":false,"title":"Support for known bits analysis with souper test cases","user":{"login":"jubitaneja","id":6600596,"avatar_url":"https://avatars.githubusercontent.com/u/6600596?v=3","gravatar_id":"","url":"https://api.github.com/users/jubitaneja","html_url":"https://github.com/jubitaneja","followers_url":"https://api.github.com/users/jubitaneja/followers","following_url":"https://api.github.com/users/jubitaneja/following{/other_user}","gists_url":"https://api.github.com/users/jubitaneja/gists{/gist_id}","starred_url":"https://api.github.com/users/jubitaneja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jubitaneja/subscriptions","organizations_url":"https://api.github.com/users/jubitaneja/orgs","repos_url":"https://api.github.com/users/jubitaneja/repos","events_url":"https://api.github.com/users/jubitaneja/events{/privacy}","received_events_url":"https://api.github.com/users/jubitaneja/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-08T23:19:06Z","updated_at":"2015-07-09T15:30:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"149fe4b4570b65139c087a944cc83d5b355d69e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/souper/pulls/195/commits","review_comments_url":"https://api.github.com/repos/google/souper/pulls/195/comments","review_comment_url":"https://api.github.com/repos/google/souper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/souper/issues/195/comments","statuses_url":"https://api.github.com/repos/google/souper/statuses/d0a3e26e4951dfd53241e069c8489d7d733dc659","head":{"label":"jubitaneja:known-bits","ref":"known-bits","sha":"d0a3e26e4951dfd53241e069c8489d7d733dc659","user":{"login":"jubitaneja","id":6600596,"avatar_url":"https://avatars.githubusercontent.com/u/6600596?v=3","gravatar_id":"","url":"https://api.github.com/users/jubitaneja","html_url":"https://github.com/jubitaneja","followers_url":"https://api.github.com/users/jubitaneja/followers","following_url":"https://api.github.com/users/jubitaneja/following{/other_user}","gists_url":"https://api.github.com/users/jubitaneja/gists{/gist_id}","starred_url":"https://api.github.com/users/jubitaneja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jubitaneja/subscriptions","organizations_url":"https://api.github.com/users/jubitaneja/orgs","repos_url":"https://api.github.com/users/jubitaneja/repos","events_url":"https://api.github.com/users/jubitaneja/events{/privacy}","received_events_url":"https://api.github.com/users/jubitaneja/received_events","type":"User","site_admin":false},"repo":{"id":20009831,"name":"souper","full_name":"jubitaneja/souper","owner":{"login":"jubitaneja","id":6600596,"avatar_url":"https://avatars.githubusercontent.com/u/6600596?v=3","gravatar_id":"","url":"https://api.github.com/users/jubitaneja","html_url":"https://github.com/jubitaneja","followers_url":"https://api.github.com/users/jubitaneja/followers","following_url":"https://api.github.com/users/jubitaneja/following{/other_user}","gists_url":"https://api.github.com/users/jubitaneja/gists{/gist_id}","starred_url":"https://api.github.com/users/jubitaneja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jubitaneja/subscriptions","organizations_url":"https://api.github.com/users/jubitaneja/orgs","repos_url":"https://api.github.com/users/jubitaneja/repos","events_url":"https://api.github.com/users/jubitaneja/events{/privacy}","received_events_url":"https://api.github.com/users/jubitaneja/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jubitaneja/souper","description":"Add more functionality in souper ","fork":true,"url":"https://api.github.com/repos/jubitaneja/souper","forks_url":"https://api.github.com/repos/jubitaneja/souper/forks","keys_url":"https://api.github.com/repos/jubitaneja/souper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jubitaneja/souper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jubitaneja/souper/teams","hooks_url":"https://api.github.com/repos/jubitaneja/souper/hooks","issue_events_url":"https://api.github.com/repos/jubitaneja/souper/issues/events{/number}","events_url":"https://api.github.com/repos/jubitaneja/souper/events","assignees_url":"https://api.github.com/repos/jubitaneja/souper/assignees{/user}","branches_url":"https://api.github.com/repos/jubitaneja/souper/branches{/branch}","tags_url":"https://api.github.com/repos/jubitaneja/souper/tags","blobs_url":"https://api.github.com/repos/jubitaneja/souper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jubitaneja/souper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jubitaneja/souper/git/refs{/sha}","trees_url":"https://api.github.com/repos/jubitaneja/souper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jubitaneja/souper/statuses/{sha}","languages_url":"https://api.github.com/repos/jubitaneja/souper/languages","stargazers_url":"https://api.github.com/repos/jubitaneja/souper/stargazers","contributors_url":"https://api.github.com/repos/jubitaneja/souper/contributors","subscribers_url":"https://api.github.com/repos/jubitaneja/souper/subscribers","subscription_url":"https://api.github.com/repos/jubitaneja/souper/subscription","commits_url":"https://api.github.com/repos/jubitaneja/souper/commits{/sha}","git_commits_url":"https://api.github.com/repos/jubitaneja/souper/git/commits{/sha}","comments_url":"https://api.github.com/repos/jubitaneja/souper/comments{/number}","issue_comment_url":"https://api.github.com/repos/jubitaneja/souper/issues/comments{/number}","contents_url":"https://api.github.com/repos/jubitaneja/souper/contents/{+path}","compare_url":"https://api.github.com/repos/jubitaneja/souper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jubitaneja/souper/merges","archive_url":"https://api.github.com/repos/jubitaneja/souper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jubitaneja/souper/downloads","issues_url":"https://api.github.com/repos/jubitaneja/souper/issues{/number}","pulls_url":"https://api.github.com/repos/jubitaneja/souper/pulls{/number}","milestones_url":"https://api.github.com/repos/jubitaneja/souper/milestones{/number}","notifications_url":"https://api.github.com/repos/jubitaneja/souper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jubitaneja/souper/labels{/name}","releases_url":"https://api.github.com/repos/jubitaneja/souper/releases{/id}","created_at":"2014-05-21T06:06:54Z","updated_at":"2015-03-03T19:50:00Z","pushed_at":"2015-07-08T23:17:25Z","git_url":"git://github.com/jubitaneja/souper.git","ssh_url":"git@github.com:jubitaneja/souper.git","clone_url":"https://github.com/jubitaneja/souper.git","svn_url":"https://github.com/jubitaneja/souper","homepage":"","size":1733,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"google:master","ref":"master","sha":"f3e966a4fa878e9db76cbc264c89216c5f34cd88","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":18458047,"name":"souper","full_name":"google/souper","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/souper","description":"A superoptimizer for LLVM IR","fork":false,"url":"https://api.github.com/repos/google/souper","forks_url":"https://api.github.com/repos/google/souper/forks","keys_url":"https://api.github.com/repos/google/souper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/souper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/souper/teams","hooks_url":"https://api.github.com/repos/google/souper/hooks","issue_events_url":"https://api.github.com/repos/google/souper/issues/events{/number}","events_url":"https://api.github.com/repos/google/souper/events","assignees_url":"https://api.github.com/repos/google/souper/assignees{/user}","branches_url":"https://api.github.com/repos/google/souper/branches{/branch}","tags_url":"https://api.github.com/repos/google/souper/tags","blobs_url":"https://api.github.com/repos/google/souper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/souper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/souper/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/souper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/souper/statuses/{sha}","languages_url":"https://api.github.com/repos/google/souper/languages","stargazers_url":"https://api.github.com/repos/google/souper/stargazers","contributors_url":"https://api.github.com/repos/google/souper/contributors","subscribers_url":"https://api.github.com/repos/google/souper/subscribers","subscription_url":"https://api.github.com/repos/google/souper/subscription","commits_url":"https://api.github.com/repos/google/souper/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/souper/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/souper/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/souper/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/souper/contents/{+path}","compare_url":"https://api.github.com/repos/google/souper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/souper/merges","archive_url":"https://api.github.com/repos/google/souper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/souper/downloads","issues_url":"https://api.github.com/repos/google/souper/issues{/number}","pulls_url":"https://api.github.com/repos/google/souper/pulls{/number}","milestones_url":"https://api.github.com/repos/google/souper/milestones{/number}","notifications_url":"https://api.github.com/repos/google/souper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/souper/labels{/name}","releases_url":"https://api.github.com/repos/google/souper/releases{/id}","created_at":"2014-04-05T02:09:09Z","updated_at":"2015-07-09T11:34:58Z","pushed_at":"2015-07-08T23:19:06Z","git_url":"git://github.com/google/souper.git","ssh_url":"git@github.com:google/souper.git","clone_url":"https://github.com/google/souper.git","svn_url":"https://github.com/google/souper","homepage":"","size":1900,"stargazers_count":188,"watchers_count":188,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":22,"forks":26,"open_issues":22,"watchers":188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/souper/pulls/195"},"html":{"href":"https://github.com/google/souper/pull/195"},"issue":{"href":"https://api.github.com/repos/google/souper/issues/195"},"comments":{"href":"https://api.github.com/repos/google/souper/issues/195/comments"},"review_comments":{"href":"https://api.github.com/repos/google/souper/pulls/195/comments"},"review_comment":{"href":"https://api.github.com/repos/google/souper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/souper/pulls/195/commits"},"statuses":{"href":"https://api.github.com/repos/google/souper/statuses/d0a3e26e4951dfd53241e069c8489d7d733dc659"}}}}