Make `compCurBB` available for `fgMorphBlockReturn`. (#34184)
authorSergey Andreenko <seandree@microsoft.com>
Tue, 31 Mar 2020 00:06:32 +0000 (17:06 -0700)
committerGitHub <noreply@github.com>
Tue, 31 Mar 2020 00:06:32 +0000 (17:06 -0700)
commitc7a1ef604300bd30f29a90237abd8351a7e283b3
tree06b3b957fdc268c38190637fc6484ca9d5a27ba6
parent162595e4fe8f641ae44f495ec3ee930a0422de2b
Make `compCurBB` available for `fgMorphBlockReturn`. (#34184)

* Extract `fgMergeBlockReturn`.

Morph is already a very vague verb in the Jit, try to use a more precise one.

* Add a function header.

* Make `compCurBB` available for `fgMorphBlockReturn`.

When we generate an assignment we could need to create a new assertion, that requires `compCurBB` to be available.

* Delete `INVALID_POINTER_VALUE`.

I would like to remove it because:
1) it was debug only;
2) there were no null checks for `compHndBBtab`, because it is a dependent variable
so there was no need to distinguish valid null pointer from a bad invalid pointer;
3) that is the only place where this mechanism was used.

* Allow to CSE the merge return ASG.

I can't see a reason why it should not, there are no diffs.
The issue with the previous version was that we did not actually know what we were marking: GT_ASG, GT_COMMA, something else? Was the idea to mark individual ASG under COMMA?
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/jit.h
src/coreclr/src/jit/jiteh.cpp
src/coreclr/src/jit/morph.cpp