{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/llilc/pulls/comments/29997776","id":29997776,"diff_hunk":"@@ -5530,20 +5772,38 @@ IRNode *GenIR::getTypedAddress(IRNode *Addr, CorInfoType CorInfoType,\n   // For the 'REFANY' case, verify the address carries\n   // reasonable typing. Address producer must ensure this.\n   if (CorInfoType == CORINFO_TYPE_REFANY) {\n-    PointerType *PointerTy = cast<PointerType>(AddressTy);\n-    Type *ReferentTy = PointerTy->getPointerElementType();\n-\n-    // The result of the load is an object reference,\n-    // So addr should be ptr to managed ptr to struct\n-    if (!ReferentTy->isPointerTy()) {\n-      // If we hit this we should fix the address producer, not\n-      // coerce the type here.\n-      throw NotYetImplementedException(\n-          \"unexpected type in load/store primitive\");\n+    PointerType *PointerTy = dyn_cast<PointerType>(AddressTy);\n+    if (PointerTy != nullptr) {\n+      Type *ReferentTy = PointerTy->getPointerElementType();\n+\n+      // The result of the load is an object reference,\n+      // So addr should be ptr to managed ptr to struct\n+      if (!ReferentTy->isPointerTy()) {\n+        // If we hit this we should fix the address producer, not\n+        // coerce the type here.\n+        throw NotYetImplementedException(\n+            \"unexpected type in load/store primitive\");\n+      }\n+      PointerType *ReferentPtrTy = cast<PointerType>(ReferentTy);\n+      ASSERT(isManagedPointerType(ReferentPtrTy));\n+      ASSERT(ReferentTy->getPointerElementType()->isStructTy());\n+    } else {\n+      // This must be a nativeint, in which case we cast the address\n+      // to an address of Object.\n+      Type *NativeIntTy =","path":"lib/Reader/readerir.cpp","position":426,"original_position":426,"commit_id":"2bd4f785703fa243498954077a15391f07f9a1f6","original_commit_id":"2bd4f785703fa243498954077a15391f07f9a1f6","user":{"login":"erozenfeld","id":10624223,"avatar_url":"https://avatars.githubusercontent.com/u/10624223?v=3","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":"The native int represents an unmanaged pointer to a GC pointer, not a GC pointer itself.That shouldn't be a problem for GC tracking, right? In any case, ldind.ref can legally take a nativeint and has to load a GC pointer so I don't see any alternative here.","created_at":"2015-05-10T01:13:12Z","updated_at":"2015-05-10T01:13:12Z","html_url":"https://github.com/dotnet/llilc/pull/562#discussion_r29997776","pull_request_url":"https://api.github.com/repos/dotnet/llilc/pulls/562","_links":{"self":{"href":"https://api.github.com/repos/dotnet/llilc/pulls/comments/29997776"},"html":{"href":"https://github.com/dotnet/llilc/pull/562#discussion_r29997776"},"pull_request":{"href":"https://api.github.com/repos/dotnet/llilc/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/llilc/pulls/562","id":35061495,"html_url":"https://github.com/dotnet/llilc/pull/562","diff_url":"https://github.com/dotnet/llilc/pull/562.diff","patch_url":"https://github.com/dotnet/llilc/pull/562.patch","issue_url":"https://api.github.com/repos/dotnet/llilc/issues/562","number":562,"state":"open","locked":false,"title":"Implement multidimensional array access intrinsics.","user":{"login":"erozenfeld","id":10624223,"avatar_url":"https://avatars.githubusercontent.com/u/10624223?v=3","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":"Implement arrayGet, arraySet, and arrayAddress to expand 2D and 3D\r\narray accesses inline; allow runtime helper to do the expansions\r\nfor arrays of other dimensions.\r\n\r\nFix getTypedAddress to deal with ldind.ref with a nativeint arg.\r\n(This was a new test failure after unblocking methods with md array\r\naccesses).\r\n\r\nRemove NYI for intrinsics in GenIR::genCall since only a fixed set\r\nof intrinsics is expected to be expanded there; the rest should be\r\nturned into runtime helper calls. Note that ReaderBase::rdrCall also\r\nlooks at intrinsics.\r\n\r\nAdd printMSIL() to dump msil for the current method.\r\n\r\nCloses #530.\r\nCloses #540.\r\nCloses #560.","created_at":"2015-05-09T04:40:48Z","updated_at":"2015-05-10T01:13:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff34c14fe385df39e15bacbf1637df17d7718db3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/llilc/pulls/562/commits","review_comments_url":"https://api.github.com/repos/dotnet/llilc/pulls/562/comments","review_comment_url":"https://api.github.com/repos/dotnet/llilc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/llilc/issues/562/comments","statuses_url":"https://api.github.com/repos/dotnet/llilc/statuses/2bd4f785703fa243498954077a15391f07f9a1f6","head":{"label":"erozenfeld:MDArrayAccessors","ref":"MDArrayAccessors","sha":"2bd4f785703fa243498954077a15391f07f9a1f6","user":{"login":"erozenfeld","id":10624223,"avatar_url":"https://avatars.githubusercontent.com/u/10624223?v=3","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":33960070,"name":"llilc","full_name":"erozenfeld/llilc","owner":{"login":"erozenfeld","id":10624223,"avatar_url":"https://avatars.githubusercontent.com/u/10624223?v=3","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/llilc","description":"This repo contains LLILC, an LLVM based compiler for .NET Core. It includes a set of cross-platform .NET code generation tools that enables compilation of MSIL byte code to LLVM supported platforms.","fork":true,"url":"https://api.github.com/repos/erozenfeld/llilc","forks_url":"https://api.github.com/repos/erozenfeld/llilc/forks","keys_url":"https://api.github.com/repos/erozenfeld/llilc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erozenfeld/llilc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erozenfeld/llilc/teams","hooks_url":"https://api.github.com/repos/erozenfeld/llilc/hooks","issue_events_url":"https://api.github.com/repos/erozenfeld/llilc/issues/events{/number}","events_url":"https://api.github.com/repos/erozenfeld/llilc/events","assignees_url":"https://api.github.com/repos/erozenfeld/llilc/assignees{/user}","branches_url":"https://api.github.com/repos/erozenfeld/llilc/branches{/branch}","tags_url":"https://api.github.com/repos/erozenfeld/llilc/tags","blobs_url":"https://api.github.com/repos/erozenfeld/llilc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erozenfeld/llilc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erozenfeld/llilc/git/refs{/sha}","trees_url":"https://api.github.com/repos/erozenfeld/llilc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erozenfeld/llilc/statuses/{sha}","languages_url":"https://api.github.com/repos/erozenfeld/llilc/languages","stargazers_url":"https://api.github.com/repos/erozenfeld/llilc/stargazers","contributors_url":"https://api.github.com/repos/erozenfeld/llilc/contributors","subscribers_url":"https://api.github.com/repos/erozenfeld/llilc/subscribers","subscription_url":"https://api.github.com/repos/erozenfeld/llilc/subscription","commits_url":"https://api.github.com/repos/erozenfeld/llilc/commits{/sha}","git_commits_url":"https://api.github.com/repos/erozenfeld/llilc/git/commits{/sha}","comments_url":"https://api.github.com/repos/erozenfeld/llilc/comments{/number}","issue_comment_url":"https://api.github.com/repos/erozenfeld/llilc/issues/comments{/number}","contents_url":"https://api.github.com/repos/erozenfeld/llilc/contents/{+path}","compare_url":"https://api.github.com/repos/erozenfeld/llilc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erozenfeld/llilc/merges","archive_url":"https://api.github.com/repos/erozenfeld/llilc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erozenfeld/llilc/downloads","issues_url":"https://api.github.com/repos/erozenfeld/llilc/issues{/number}","pulls_url":"https://api.github.com/repos/erozenfeld/llilc/pulls{/number}","milestones_url":"https://api.github.com/repos/erozenfeld/llilc/milestones{/number}","notifications_url":"https://api.github.com/repos/erozenfeld/llilc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erozenfeld/llilc/labels{/name}","releases_url":"https://api.github.com/repos/erozenfeld/llilc/releases{/id}","created_at":"2015-04-14T22:21:16Z","updated_at":"2015-04-14T22:21:17Z","pushed_at":"2015-05-09T04:39:39Z","git_url":"git://github.com/erozenfeld/llilc.git","ssh_url":"git@github.com:erozenfeld/llilc.git","clone_url":"https://github.com/erozenfeld/llilc.git","svn_url":"https://github.com/erozenfeld/llilc","homepage":"","size":5161,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"dotnet:master","ref":"master","sha":"00d1e7613ab6bc171f83c203bbeaf519fc726dd4","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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":30043131,"name":"llilc","full_name":"dotnet/llilc","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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/llilc","description":"This repo contains LLILC, an LLVM based compiler for .NET Core. It includes a set of cross-platform .NET code generation tools that enables compilation of MSIL byte code to LLVM supported platforms.","fork":false,"url":"https://api.github.com/repos/dotnet/llilc","forks_url":"https://api.github.com/repos/dotnet/llilc/forks","keys_url":"https://api.github.com/repos/dotnet/llilc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/llilc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/llilc/teams","hooks_url":"https://api.github.com/repos/dotnet/llilc/hooks","issue_events_url":"https://api.github.com/repos/dotnet/llilc/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/llilc/events","assignees_url":"https://api.github.com/repos/dotnet/llilc/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/llilc/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/llilc/tags","blobs_url":"https://api.github.com/repos/dotnet/llilc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/llilc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/llilc/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/llilc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/llilc/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/llilc/languages","stargazers_url":"https://api.github.com/repos/dotnet/llilc/stargazers","contributors_url":"https://api.github.com/repos/dotnet/llilc/contributors","subscribers_url":"https://api.github.com/repos/dotnet/llilc/subscribers","subscription_url":"https://api.github.com/repos/dotnet/llilc/subscription","commits_url":"https://api.github.com/repos/dotnet/llilc/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/llilc/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/llilc/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/llilc/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/llilc/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/llilc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/llilc/merges","archive_url":"https://api.github.com/repos/dotnet/llilc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/llilc/downloads","issues_url":"https://api.github.com/repos/dotnet/llilc/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/llilc/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/llilc/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/llilc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/llilc/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/llilc/releases{/id}","created_at":"2015-01-29T21:52:01Z","updated_at":"2015-05-09T10:19:28Z","pushed_at":"2015-05-09T19:28:04Z","git_url":"git://github.com/dotnet/llilc.git","ssh_url":"git@github.com:dotnet/llilc.git","clone_url":"https://github.com/dotnet/llilc.git","svn_url":"https://github.com/dotnet/llilc","homepage":"","size":12376,"stargazers_count":696,"watchers_count":696,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":135,"forks":56,"open_issues":135,"watchers":696,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/llilc/pulls/562"},"html":{"href":"https://github.com/dotnet/llilc/pull/562"},"issue":{"href":"https://api.github.com/repos/dotnet/llilc/issues/562"},"comments":{"href":"https://api.github.com/repos/dotnet/llilc/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/llilc/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/llilc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/llilc/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/llilc/statuses/2bd4f785703fa243498954077a15391f07f9a1f6"}}}}