Goose  Diff

Differences From Artifact [a647fe2a4e]:

  • File bs/cir/instruction.cpp — part of check-in [4cc7a833f8] at 2021-01-03 15:44:11 on branch trunk — cir: load, store and select store their base addresses directly as cir instructiions, rather than wrapped into eir values, which is useless there. (user: achavasse size: 1653)

To Artifact [7b535ec996]:

  • File bs/cir/instruction.cpp — part of check-in [90c951f66f] at 2021-01-12 21:08:37 on branch trunk — Implemented missing lowering of reference types to pointer types, added a bunch of runtime/compilation time reference tests. (user: achavasse size: 979)

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

58
59
24
25
26
27
28
29
30























31
32


33
34
35







-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-


-
-
+


            else if constexpr( is_same_v< ET, ptr< CFG > > )
                return e->canBeEagerlyEvaluated();
            else
                return e.canBeEagerlyEvaluated();
        }, m_content );
    }

    bool Instruction::isCompTimeStackAddr() const
    {
        return visit( []< typename ET >( const ET& e )
        {
            if constexpr( is_same_v< ET, monostate > )
                return false;
            else if constexpr( is_same_v< ET, ptr< CFG > > )
                return false;
            else
                return e.isCompTimeStackAddr();
        }, m_content );
    }

    bool Select::isCompTimeStackAddr() const
    {
        return m_baseAddr && m_baseAddr->isCompTimeStackAddr();
    }

    bool Load::canBeEagerlyEvaluated() const
    {
        return m_addr && m_addr->isCompTimeStackAddr();
    }

    bool Store::canBeEagerlyEvaluated() const
    {
        return m_addr && m_addr->isCompTimeStackAddr()
            && CanValueBeEagerlyEvaluated( m_val );
        return m_addr && CanValueBeEagerlyEvaluated( m_val );
    }
}