{"action":"created","comment":{"url":"https://api.github.com/repos/weld-project/weld/pulls/comments/236455585","pull_request_review_id":178535333,"id":236455585,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjQ1NTU4NQ==","diff_hunk":"@@ -1245,8 +1259,60 @@ impl LlvmGenerator {\n                     unreachable!()\n                 }\n             }\n-            Sort { .. } => {\n-                unimplemented!() // Sort\n+            Sort { ref child, ref cmpfunc } => { // cmpfunc is an SirFunction\n+                let output_pointer = context.get_value(output)?;\n+                let output_type = context.sir_function.symbol_type(\n+                    statement.output.as_ref().unwrap())?;\n+                \n+                if let Vector(ref elem_ty) = *output_type {\n+                    let child_value = self.load(context.builder, context.get_value(child)?)?;\n+                    let child_type = context.sir_function.symbol_type(child)?;\n+\n+                    use ast::Type::Scalar;\n+                    use ast::ScalarKind;\n+                    use self::vector::VectorExt;\n+                    let zero = self.zero(self.i64_type());\n+                    let child_elems = self.gen_at(context.builder, child_type, child_value, zero)?;\n+                    let elems_ptr = LLVMBuildBitCast(context.builder, child_elems,\n+                                                     self.void_pointer_type(),\n+                                                     c_str!(\"\"));\n+                    let size = self.gen_size(context.builder, child_type, child_value)?;\n+                    let mut elem_ll_ty = self.llvm_type(&*elem_ty)?;\n+                    let ty_size = self.size_of(elem_ll_ty);\n+                    \n+                    use self::cmp::GenCmp;\n+                    let cmpfunc_ll_fn = self.functions[cmpfunc];\n+\n+                    let run = context.get_run();\n+\n+                    // Generate the comparator from the provided custom code.\n+                    // The custom comparator can only make use of BinOps that are supported by Weld","path":"weld/codegen/llvm2/mod.rs","position":107,"original_position":107,"commit_id":"188f66d60f32a430b2f8d28fd6a6fd34fea926ce","original_commit_id":"188f66d60f32a430b2f8d28fd6a6fd34fea926ce","user":{"login":"pratiksha","id":553500,"node_id":"MDQ6VXNlcjU1MzUwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/553500?v=4","gravatar_id":"","url":"https://api.github.com/users/pratiksha","html_url":"https://github.com/pratiksha","followers_url":"https://api.github.com/users/pratiksha/followers","following_url":"https://api.github.com/users/pratiksha/following{/other_user}","gists_url":"https://api.github.com/users/pratiksha/gists{/gist_id}","starred_url":"https://api.github.com/users/pratiksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratiksha/subscriptions","organizations_url":"https://api.github.com/users/pratiksha/orgs","repos_url":"https://api.github.com/users/pratiksha/repos","events_url":"https://api.github.com/users/pratiksha/events{/privacy}","received_events_url":"https://api.github.com/users/pratiksha/received_events","type":"User","site_admin":false},"body":"The point was you can't use BinOps on dicts or something where there isn't a default comparator, but I see how this comment is confusing","created_at":"2018-11-26T22:38:25Z","updated_at":"2018-11-26T22:38:25Z","html_url":"https://github.com/weld-project/weld/pull/421#discussion_r236455585","pull_request_url":"https://api.github.com/repos/weld-project/weld/pulls/421","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/weld-project/weld/pulls/comments/236455585"},"html":{"href":"https://github.com/weld-project/weld/pull/421#discussion_r236455585"},"pull_request":{"href":"https://api.github.com/repos/weld-project/weld/pulls/421"}},"in_reply_to_id":236386710},"pull_request":{"url":"https://api.github.com/repos/weld-project/weld/pulls/421","id":233077264,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMDc3MjY0","html_url":"https://github.com/weld-project/weld/pull/421","diff_url":"https://github.com/weld-project/weld/pull/421.diff","patch_url":"https://github.com/weld-project/weld/pull/421.patch","issue_url":"https://api.github.com/repos/weld-project/weld/issues/421","number":421,"state":"open","locked":false,"title":"Sort for vectors and structs, plus custom comparators","user":{"login":"pratiksha","id":553500,"node_id":"MDQ6VXNlcjU1MzUwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/553500?v=4","gravatar_id":"","url":"https://api.github.com/users/pratiksha","html_url":"https://github.com/pratiksha","followers_url":"https://api.github.com/users/pratiksha/followers","following_url":"https://api.github.com/users/pratiksha/following{/other_user}","gists_url":"https://api.github.com/users/pratiksha/gists{/gist_id}","starred_url":"https://api.github.com/users/pratiksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratiksha/subscriptions","organizations_url":"https://api.github.com/users/pratiksha/orgs","repos_url":"https://api.github.com/users/pratiksha/repos","events_url":"https://api.github.com/users/pratiksha/events{/privacy}","received_events_url":"https://api.github.com/users/pratiksha/received_events","type":"User","site_admin":false},"body":":turkey: \r\n\r\n- Replace `keyfunc` with custom comparator\r\n- Add `compare` macro to standard macros\r\n- Add default comparator BinOps (<, <=, >, >=) for vectors and structs\r\n- Implement sort call","created_at":"2018-11-22T21:53:47Z","updated_at":"2018-11-26T22:38:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19d960ccf685eb3debe184ed974dc320668fc82d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/weld-project/weld/pulls/421/commits","review_comments_url":"https://api.github.com/repos/weld-project/weld/pulls/421/comments","review_comment_url":"https://api.github.com/repos/weld-project/weld/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weld-project/weld/issues/421/comments","statuses_url":"https://api.github.com/repos/weld-project/weld/statuses/188f66d60f32a430b2f8d28fd6a6fd34fea926ce","head":{"label":"pratiksha:sort","ref":"sort","sha":"188f66d60f32a430b2f8d28fd6a6fd34fea926ce","user":{"login":"pratiksha","id":553500,"node_id":"MDQ6VXNlcjU1MzUwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/553500?v=4","gravatar_id":"","url":"https://api.github.com/users/pratiksha","html_url":"https://github.com/pratiksha","followers_url":"https://api.github.com/users/pratiksha/followers","following_url":"https://api.github.com/users/pratiksha/following{/other_user}","gists_url":"https://api.github.com/users/pratiksha/gists{/gist_id}","starred_url":"https://api.github.com/users/pratiksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratiksha/subscriptions","organizations_url":"https://api.github.com/users/pratiksha/orgs","repos_url":"https://api.github.com/users/pratiksha/repos","events_url":"https://api.github.com/users/pratiksha/events{/privacy}","received_events_url":"https://api.github.com/users/pratiksha/received_events","type":"User","site_admin":false},"repo":{"id":102075985,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIwNzU5ODU=","name":"weld","full_name":"pratiksha/weld","private":false,"owner":{"login":"pratiksha","id":553500,"node_id":"MDQ6VXNlcjU1MzUwMA==","avatar_url":"https://avatars0.githubusercontent.com/u/553500?v=4","gravatar_id":"","url":"https://api.github.com/users/pratiksha","html_url":"https://github.com/pratiksha","followers_url":"https://api.github.com/users/pratiksha/followers","following_url":"https://api.github.com/users/pratiksha/following{/other_user}","gists_url":"https://api.github.com/users/pratiksha/gists{/gist_id}","starred_url":"https://api.github.com/users/pratiksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pratiksha/subscriptions","organizations_url":"https://api.github.com/users/pratiksha/orgs","repos_url":"https://api.github.com/users/pratiksha/repos","events_url":"https://api.github.com/users/pratiksha/events{/privacy}","received_events_url":"https://api.github.com/users/pratiksha/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pratiksha/weld","description":"Weld is a runtime and language for accelerating data analytics frameworks","fork":true,"url":"https://api.github.com/repos/pratiksha/weld","forks_url":"https://api.github.com/repos/pratiksha/weld/forks","keys_url":"https://api.github.com/repos/pratiksha/weld/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pratiksha/weld/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pratiksha/weld/teams","hooks_url":"https://api.github.com/repos/pratiksha/weld/hooks","issue_events_url":"https://api.github.com/repos/pratiksha/weld/issues/events{/number}","events_url":"https://api.github.com/repos/pratiksha/weld/events","assignees_url":"https://api.github.com/repos/pratiksha/weld/assignees{/user}","branches_url":"https://api.github.com/repos/pratiksha/weld/branches{/branch}","tags_url":"https://api.github.com/repos/pratiksha/weld/tags","blobs_url":"https://api.github.com/repos/pratiksha/weld/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pratiksha/weld/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pratiksha/weld/git/refs{/sha}","trees_url":"https://api.github.com/repos/pratiksha/weld/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pratiksha/weld/statuses/{sha}","languages_url":"https://api.github.com/repos/pratiksha/weld/languages","stargazers_url":"https://api.github.com/repos/pratiksha/weld/stargazers","contributors_url":"https://api.github.com/repos/pratiksha/weld/contributors","subscribers_url":"https://api.github.com/repos/pratiksha/weld/subscribers","subscription_url":"https://api.github.com/repos/pratiksha/weld/subscription","commits_url":"https://api.github.com/repos/pratiksha/weld/commits{/sha}","git_commits_url":"https://api.github.com/repos/pratiksha/weld/git/commits{/sha}","comments_url":"https://api.github.com/repos/pratiksha/weld/comments{/number}","issue_comment_url":"https://api.github.com/repos/pratiksha/weld/issues/comments{/number}","contents_url":"https://api.github.com/repos/pratiksha/weld/contents/{+path}","compare_url":"https://api.github.com/repos/pratiksha/weld/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pratiksha/weld/merges","archive_url":"https://api.github.com/repos/pratiksha/weld/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pratiksha/weld/downloads","issues_url":"https://api.github.com/repos/pratiksha/weld/issues{/number}","pulls_url":"https://api.github.com/repos/pratiksha/weld/pulls{/number}","milestones_url":"https://api.github.com/repos/pratiksha/weld/milestones{/number}","notifications_url":"https://api.github.com/repos/pratiksha/weld/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pratiksha/weld/labels{/name}","releases_url":"https://api.github.com/repos/pratiksha/weld/releases{/id}","deployments_url":"https://api.github.com/repos/pratiksha/weld/deployments","created_at":"2017-09-01T05:11:27Z","updated_at":"2018-05-11T20:49:42Z","pushed_at":"2018-11-24T07:54:33Z","git_url":"git://github.com/pratiksha/weld.git","ssh_url":"git@github.com:pratiksha/weld.git","clone_url":"https://github.com/pratiksha/weld.git","svn_url":"https://github.com/pratiksha/weld","homepage":"weld.stanford.edu","size":2909,"stargazers_count":1,"watchers_count":1,"language":"Rust","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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"weld-project:llvm-st","ref":"llvm-st","sha":"d7948d937de3a327cb1586ff2a8afb498e8642f2","user":{"login":"weld-project","id":23513568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTEzNTY4","avatar_url":"https://avatars1.githubusercontent.com/u/23513568?v=4","gravatar_id":"","url":"https://api.github.com/users/weld-project","html_url":"https://github.com/weld-project","followers_url":"https://api.github.com/users/weld-project/followers","following_url":"https://api.github.com/users/weld-project/following{/other_user}","gists_url":"https://api.github.com/users/weld-project/gists{/gist_id}","starred_url":"https://api.github.com/users/weld-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weld-project/subscriptions","organizations_url":"https://api.github.com/users/weld-project/orgs","repos_url":"https://api.github.com/users/weld-project/repos","events_url":"https://api.github.com/users/weld-project/events{/privacy}","received_events_url":"https://api.github.com/users/weld-project/received_events","type":"Organization","site_admin":false},"repo":{"id":61008232,"node_id":"MDEwOlJlcG9zaXRvcnk2MTAwODIzMg==","name":"weld","full_name":"weld-project/weld","private":false,"owner":{"login":"weld-project","id":23513568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTEzNTY4","avatar_url":"https://avatars1.githubusercontent.com/u/23513568?v=4","gravatar_id":"","url":"https://api.github.com/users/weld-project","html_url":"https://github.com/weld-project","followers_url":"https://api.github.com/users/weld-project/followers","following_url":"https://api.github.com/users/weld-project/following{/other_user}","gists_url":"https://api.github.com/users/weld-project/gists{/gist_id}","starred_url":"https://api.github.com/users/weld-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weld-project/subscriptions","organizations_url":"https://api.github.com/users/weld-project/orgs","repos_url":"https://api.github.com/users/weld-project/repos","events_url":"https://api.github.com/users/weld-project/events{/privacy}","received_events_url":"https://api.github.com/users/weld-project/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/weld-project/weld","description":"High-performance runtime for data analytics applications","fork":false,"url":"https://api.github.com/repos/weld-project/weld","forks_url":"https://api.github.com/repos/weld-project/weld/forks","keys_url":"https://api.github.com/repos/weld-project/weld/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weld-project/weld/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weld-project/weld/teams","hooks_url":"https://api.github.com/repos/weld-project/weld/hooks","issue_events_url":"https://api.github.com/repos/weld-project/weld/issues/events{/number}","events_url":"https://api.github.com/repos/weld-project/weld/events","assignees_url":"https://api.github.com/repos/weld-project/weld/assignees{/user}","branches_url":"https://api.github.com/repos/weld-project/weld/branches{/branch}","tags_url":"https://api.github.com/repos/weld-project/weld/tags","blobs_url":"https://api.github.com/repos/weld-project/weld/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weld-project/weld/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weld-project/weld/git/refs{/sha}","trees_url":"https://api.github.com/repos/weld-project/weld/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weld-project/weld/statuses/{sha}","languages_url":"https://api.github.com/repos/weld-project/weld/languages","stargazers_url":"https://api.github.com/repos/weld-project/weld/stargazers","contributors_url":"https://api.github.com/repos/weld-project/weld/contributors","subscribers_url":"https://api.github.com/repos/weld-project/weld/subscribers","subscription_url":"https://api.github.com/repos/weld-project/weld/subscription","commits_url":"https://api.github.com/repos/weld-project/weld/commits{/sha}","git_commits_url":"https://api.github.com/repos/weld-project/weld/git/commits{/sha}","comments_url":"https://api.github.com/repos/weld-project/weld/comments{/number}","issue_comment_url":"https://api.github.com/repos/weld-project/weld/issues/comments{/number}","contents_url":"https://api.github.com/repos/weld-project/weld/contents/{+path}","compare_url":"https://api.github.com/repos/weld-project/weld/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weld-project/weld/merges","archive_url":"https://api.github.com/repos/weld-project/weld/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weld-project/weld/downloads","issues_url":"https://api.github.com/repos/weld-project/weld/issues{/number}","pulls_url":"https://api.github.com/repos/weld-project/weld/pulls{/number}","milestones_url":"https://api.github.com/repos/weld-project/weld/milestones{/number}","notifications_url":"https://api.github.com/repos/weld-project/weld/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weld-project/weld/labels{/name}","releases_url":"https://api.github.com/repos/weld-project/weld/releases{/id}","deployments_url":"https://api.github.com/repos/weld-project/weld/deployments","created_at":"2016-06-13T05:00:24Z","updated_at":"2018-11-26T07:00:01Z","pushed_at":"2018-11-25T19:57:46Z","git_url":"git://github.com/weld-project/weld.git","ssh_url":"git@github.com:weld-project/weld.git","clone_url":"https://github.com/weld-project/weld.git","svn_url":"https://github.com/weld-project/weld","homepage":"https://www.weld.rs","size":2528,"stargazers_count":993,"watchers_count":993,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":124,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":124,"open_issues":50,"watchers":993,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weld-project/weld/pulls/421"},"html":{"href":"https://github.com/weld-project/weld/pull/421"},"issue":{"href":"https://api.github.com/repos/weld-project/weld/issues/421"},"comments":{"href":"https://api.github.com/repos/weld-project/weld/issues/421/comments"},"review_comments":{"href":"https://api.github.com/repos/weld-project/weld/pulls/421/comments"},"review_comment":{"href":"https://api.github.com/repos/weld-project/weld/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weld-project/weld/pulls/421/commits"},"statuses":{"href":"https://api.github.com/repos/weld-project/weld/statuses/188f66d60f32a430b2f8d28fd6a6fd34fea926ce"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pratiksha"}}