The check.sh script always runs the Python unittests with 'python', but
if 'python3' is in the path, run it with that too.
Fix a Python 3 compat issue and avoid passing None to max() and min().
Use an explicit intersect() function instead to intersect intervals.
The check.sh script always runs the Python unittests with 'python', but
if 'python3' is in the path, run it with that too.
Fix a Python 3 compat issue and avoid passing None to max() and min().
Use an explicit intersect() function instead to intersect intervals.
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.