dotnet/runtime

Unexplained ref count sorting for ARM only

Open

#10.365 geöffnet am 22. Mai 2018

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (5.445 Forks)batch import
area-CodeGen-coreclrhelp wanted

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide