dotnet/runtime

Unexplained ref count sorting for ARM only

Open

#10.365 aperta il 22 mag 2018

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)C# (5445 fork)batch import
area-CodeGen-coreclrhelp wanted

Metriche repository

Star
 (17.886 star)
Metriche merge PR
 (Merge medio 12g 11h) (661 PR mergiate in 30 g)

Descrizione

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

Guida contributor