Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/ion/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  merge-phi-usage-analysis.js   Sprache: JAVA

 

function expensive() {
    with({}) {}
}

function phi_merge_0(i) {
    // These computations can overflow, if the output is not truncated.
    i = i | 0;
    var a0 = i + i;
    var a1 = i + i;

    if ((a1 | 0) - ((2 * i) | 0)) {
        // Good candidate for branch pruning, which marks only a1 as having
        // removed uses.
        expensive();
        expensive();
        expensive();
        expensive();
        expensive();
    }

    // Simple branch made to let GVN merge the Phi instructions.
    if (a1 % 3 == 1) {
        a1 = 2 * i;
        a0 = 2 * i;
    }

    // a0 is never used, but a1 is truncated.
    return a1 | 0;
}

function phi_merge_1(i) {
    // These computations can overflow, if the output is not truncated.
    i = i | 0;
    var a1 = i + i;
    var a0 = i + i;

    if ((a1 | 0) - ((2 * i) | 0)) {
        // Good candidate for branch pruning, which marks only a1 as having
        // removed uses.
        expensive();
        expensive();
        expensive();
        expensive();
        expensive();
    }

    // Simple branch made to let GVN merge the Phi instructions.
    if (a1 % 3 == 1) {
        a1 = 2 * i;
        a0 = 2 * i;
    }

    // a0 is never used, but a1 is truncated.
    return a1 | 0;
}

for (var j = 0; j < 300; j++) {
    for (var i = 1; i == (i | 0); i = 2 * i + 1) {
        assertEq(phi_merge_0(i) < 0x80000000, true);
        assertEq(phi_merge_1(i) < 0x80000000, true);
    }
}

Messung V0.5
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.