{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/llilc/issues/786","labels_url":"https://api.github.com/repos/dotnet/llilc/issues/786/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/llilc/issues/786/comments","events_url":"https://api.github.com/repos/dotnet/llilc/issues/786/events","html_url":"https://github.com/dotnet/llilc/pull/786","id":102929343,"number":786,"title":"Fix PHI update logic.","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},"labels":[{"url":"https://api.github.com/repos/dotnet/llilc/labels/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-25T01:38:36Z","updated_at":"2015-08-25T14:49:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/llilc/pulls/786","html_url":"https://github.com/dotnet/llilc/pull/786","diff_url":"https://github.com/dotnet/llilc/pull/786.diff","patch_url":"https://github.com/dotnet/llilc/pull/786.patch"},"body":"If a block terminator is\r\nbr i1 %6, label %7, label %7\r\nand the operand stack is not empty,\r\nwe'll create a PHI instruction in the successor block with an undef operand:\r\n; <label>:7                                       ; preds = %2, %2\r\n  %8 = phi i32 [ %3, %2 ], [ undef, %2 ]\r\n...\r\n; <label>:9                                       ; preds = %7\r\n  %10 = add i32 %8, 3\r\n\r\nWe never update the undef in this case.\r\n\r\nllvm::removeUnreachableBlocks calls llvm::constantFoldTerminator\r\nand optimizes the br instruction above so that the above code becomes\r\n\r\nbr label %5\r\n\r\n; <label>:5                                       ; preds = %4\r\n  %6 = add i32 undef, 3\r\n\r\nwhich is a problem. This was causing 6 of our tests to fail.\r\n\r\nThe fix is to update all PHI operands corresponding to a predecessor,\r\nnot just one.\r\n\r\nCloses #785."},"comment":{"url":"https://api.github.com/repos/dotnet/llilc/issues/comments/134610858","html_url":"https://github.com/dotnet/llilc/pull/786#issuecomment-134610858","issue_url":"https://api.github.com/repos/dotnet/llilc/issues/786","id":134610858,"user":{"login":"mmitche","id":8725170,"avatar_url":"https://avatars.githubusercontent.com/u/8725170?v=3","gravatar_id":"","url":"https://api.github.com/users/mmitche","html_url":"https://github.com/mmitche","followers_url":"https://api.github.com/users/mmitche/followers","following_url":"https://api.github.com/users/mmitche/following{/other_user}","gists_url":"https://api.github.com/users/mmitche/gists{/gist_id}","starred_url":"https://api.github.com/users/mmitche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmitche/subscriptions","organizations_url":"https://api.github.com/users/mmitche/orgs","repos_url":"https://api.github.com/users/mmitche/repos","events_url":"https://api.github.com/users/mmitche/events{/privacy}","received_events_url":"https://api.github.com/users/mmitche/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T14:49:28Z","updated_at":"2015-08-25T14:49:28Z","body":"@dotnet-bot test this please"}}