runtime: CQ: Don't force const arguments to temps.
Morph has a following todo: https://github.com/dotnet/runtime/blob/96019a4bccb8e31f4f13f701099550c9cf136e22/src/coreclr/jit/morph.cpp#L1343-L1346
so the code should look like:
GenTree* arg = prevArgTabEntry->GetNode();
GenTree* lclVarTree = nullptr;
if (!arg ->OperIsConst() && !impIsAddressInLocal(arg , &lclVarTree))
{
}
In addition, there are other similar places, from a quick search:
- the one that is mentioned above;
- https://github.com/dotnet/runtime/blob/96019a4bccb8e31f4f13f701099550c9cf136e22/src/coreclr/jit/importer.cpp#L19398
- https://github.com/dotnet/runtime/blob/96019a4bccb8e31f4f13f701099550c9cf136e22/src/coreclr/jit/gentree.cpp#L2848
- https://github.com/dotnet/runtime/blob/96019a4bccb8e31f4f13f701099550c9cf136e22/src/coreclr/jit/gentree.h#L2184
I recommend creating a new helper Compiler::IsInvariant(GenTree* tree)
with a proper function header. Then use it in appropriate places.
The fix should have jit-asm diffs before/after.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (23 by maintainers)
Here’s the diff for all libraries: