dotnet/runtime

Unexplained ref count sorting for ARM only

Open

#10.365 aberto em 22 de mai. de 2018

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)C# (5.445 forks)batch import
area-CodeGen-coreclrhelp wanted

Métricas do repositório

Stars
 (17.886 stars)
Métricas de merge de PR
 (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)

Description

The following code in Compiler::WtdRefCntCmp() (and also in the currently-unused Compiler::RefCntCmp) is only for non-ARM targets. This seems strange and unexplained. Should the #ifndef be removed to make it all platform? This causes exactly one diff in ARM altjit asm diffs over the frameworks, a case with a huge function where a float variable ends up on the stack instead of in registers, causing loads and stores where they didn't exist previously.

Or, should the code be removed entirely, because it is not applicable or desirable with the current system?

#ifndef _TARGET_ARM_
    // ARM-TODO: this was disabled for ARM under !FEATURE_FP_REGALLOC; it was probably a left-over from
    // legacy backend. It should be enabled and verified.

    /* Force integer candidates to sort above float candidates */

    bool isFloat1 = isFloatRegType(dsc1->lvType);
    bool isFloat2 = isFloatRegType(dsc2->lvType);

    if (isFloat1 != isFloat2)
    {
        if (weight2 && isFloat1)
        {
            return +1;
        }
        if (weight1 && isFloat2)
        {
            return -1;
        }
    }

category:cq theme:basic-cq skill-level:intermediate cost:small impact:small

Guia do colaborador