Clean up fgRemoveDeadStore.
authorEugene Rozenfeld <erozen@microsoft.com>
Fri, 26 Apr 2019 23:16:05 +0000 (16:16 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Sat, 27 Apr 2019 00:35:14 +0000 (17:35 -0700)
commitf349a2ce98dc240da2e6da7038905a2186f7baa2
tree22e1827d1f3e8d5fcaa467eb003dcd33842e4659
parent9d42c6540d3e54322e76c38e5ca840510b1a8638
Clean up fgRemoveDeadStore.

Remove duplication and a couple of goto's from `fgRemoveDeadStore`.

This part was very confusing:

`
                /* If this is GT_CATCH_ARG saved to a local var don't bother */

                JITDUMP("removing stmt with no side effects\n");

                if (asgNode->gtFlags & GTF_ORDER_SIDEEFF)
                {
                    if (rhsNode->gtOper == GT_CATCH_ARG)
                    {
                        goto EXTRACT_SIDE_EFFECTS;
                    }
                }
`

The `goto` was to the preceding `if` and was useless since the call
to `gtExtractSideEffList(rhsNode, &sideEffList);` couldn't possibly find
side effects because we already checked that
`rhsNode->gtFlags & GTF_SIDE_EFFECT == 0`.

Commit migrated from https://github.com/dotnet/coreclr/commit/dc389a8a3378972b42200ce9644fb482ec477543
src/coreclr/src/jit/liveness.cpp