This is a work in progress. The 'legalizer.rs' file generated by
gen_legalizer.py is not used for anything yet.
Add PEP 484 type annotations to a bunch of Python code.
This is a work in progress. The 'legalizer.rs' file generated by
gen_legalizer.py is not used for anything yet.
Add PEP 484 type annotations to a bunch of Python code.
The InstructionFormat objects make their non-value operands available as
FormatField attributes for use by predicates etc.
Compute these on demand instead of up front. This makes it possible for
the mypy tool to infer the types of these attributes from the
__getattr__ signature.
The InstructionFormat objects make their non-value operands available as
FormatField attributes for use by predicates etc.
Compute these on demand instead of up front. This makes it possible for
the mypy tool to infer the types of these attributes from the
__getattr__ signature.
A extended value can now be changed to a third form: An alias of another
value. This is like a copy instruction, but implicit in the value table.
Value aliases are used in lieu of use-def chains which would be used to
implement replace-all-uses-with.
Added new DFG methods:
- change_to_alias() changes an existing extended value into an alias.
Primay values can't be changed, replace their definition with a copy
instruction instead.
- resolve_aliases() find the original non-alias value.
- resolve_copies() like resolve_aliases(), but also sees through
copy/spill/fill instructions.
A extended value can now be changed to a third form: An alias of another
value. This is like a copy instruction, but implicit in the value table.
Value aliases are used in lieu of use-def chains which would be used to
implement replace-all-uses-with.
Added new DFG methods:
- change_to_alias() changes an existing extended value into an alias.
Primay values can't be changed, replace their definition with a copy
instruction instead.
- resolve_aliases() find the original non-alias value.
- resolve_copies() like resolve_aliases(), but also sees through
copy/spill/fill instructions.
Polymorphic single-result instructions don't always return the
controlling type variable as their first result. They may use a derived
type variable, as for example icmp does.
Polymorphic single-result instructions don't always return the
controlling type variable as their first result. They may use a derived
type variable, as for example icmp does.
All scalar types are mapped to b1 which is usually what you want for a
scalar. Vector types have their lanes mapped to the wider boolean types.
Add an as_bool_pedantic() methos that produces the scalar sized boolean
types as before.
Also add a friendlier Debug implementation for Type.
All scalar types are mapped to b1 which is usually what you want for a
scalar. Vector types have their lanes mapped to the wider boolean types.
Add an as_bool_pedantic() methos that produces the scalar sized boolean
types as before.
Also add a friendlier Debug implementation for Type.
The copy/spill/fill instructions will be used by the register allocator
for splitting live ranges. The copy instruction is also useful when
rewriting values:
If a primary value is rewritten as a secondary result, a copy
instruction can be used instead:
a = foo x
=>
t, vx1 = call ...
a = copy vx1
Since a primary value must be the first value of an instruction, this
doesn't work:
a = foo x
=>
t, a = call ...
The copy/spill/fill instructions will be used by the register allocator
for splitting live ranges. The copy instruction is also useful when
rewriting values:
If a primary value is rewritten as a secondary result, a copy
instruction can be used instead:
a = foo x
=>
t, vx1 = call ...
a = copy vx1
Since a primary value must be the first value of an instruction, this
doesn't work:
a = foo x
=>
t, a = call ...
The DataFlowGraph::replace(inst) method returns an instruction builder
that will replace an instruction in-place.
This will be used when transforming instructions, replacing an old
instruction with a new (legal) way of computing its primary value. Since
primary result values are essentially instruction pointers, this is the
only way of replacing the definition of a value.
If secondary result values match the old instruction in both number and
types, they can be reused. If not, added a detach_secondary_results()
method for detaching old secondary values.
The DataFlowGraph::replace(inst) method returns an instruction builder
that will replace an instruction in-place.
This will be used when transforming instructions, replacing an old
instruction with a new (legal) way of computing its primary value. Since
primary result values are essentially instruction pointers, this is the
only way of replacing the definition of a value.
If secondary result values match the old instruction in both number and
types, they can be reused. If not, added a detach_secondary_results()
method for detaching old secondary values.
All the InstrBuilder methods now consume the builder, and the non-leaf
methods return the dfg mutable reference they were holding.
This makes it possible to construct instruction builders that are only
safe to use once because they are doing more advanced value rewriting.
All the InstrBuilder methods now consume the builder, and the non-leaf
methods return the dfg mutable reference they were holding.
This makes it possible to construct instruction builders that are only
safe to use once because they are doing more advanced value rewriting.
Rewrite Builder uses in test cases to use this method and construct a
new builder for each instruction. This pattern allows us to change the
InstBuilder trait to a one-shot implementation that can only create a
single instruction.
Don't re-export the Builder struct, it is less important than the
InstBuilder trait, and we may get more implementations.
Rewrite Builder uses in test cases to use this method and construct a
new builder for each instruction. This pattern allows us to change the
InstBuilder trait to a one-shot implementation that can only create a
single instruction.
Don't re-export the Builder struct, it is less important than the
InstBuilder trait, and we may get more implementations.
Distinguish the lifetime of the Cursor and its referenced function
layout.
Use two separate function lifetimes: 'fc and 'fd. The borrow checker
seems to get confused if we don't.
Distinguish the lifetime of the Cursor and its referenced function
layout.
Use two separate function lifetimes: 'fc and 'fd. The borrow checker
seems to get confused if we don't.
All of the instruction format an opcode methods are emitted as an
InstBuilder trait instead of adding them to the Bulder struct directly.
The methods only make use of the InstBuilderBase methods to create new
instructions.
This makes it possible to reuse the InstBuilder trait for different ways
of inserting instructions.
All of the instruction format an opcode methods are emitted as an
InstBuilder trait instead of adding them to the Bulder struct directly.
The methods only make use of the InstBuilderBase methods to create new
instructions.
This makes it possible to reuse the InstBuilder trait for different ways
of inserting instructions.