Commit Graph

10 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
9df0b09301 Add an inst.all_typevars() method.
Get all type variables controlling an instruction, whether it is
polymorphic or not.
2017-07-28 14:45:56 -07:00
Dimo
7d1a9c7d81 When doing ti on a polymorphic definition first unify the control variable, then the rest. 2017-07-28 10:47:08 -07:00
Dimo
345d6754f5 Change TV ranking to select src vars as a representative during unification; Nit: cleanup dot() emitting code; Nit: fix small bug in verify_semantics() - make an internal copy of src rtl to avoid clobbering of typevars re-used in multiple definitions 2017-07-25 15:38:48 -07:00
Dimo
40c86d58b9 Add insturction semantics. Add semantics for vsplit,vconcat,iadd. Add initial tests 2017-07-24 14:08:44 -07:00
Dimo
15a7d50765 Rename Dict[Var, TypeVar] to VarTyping; Add VarMap (Dict[Var,Var]). Add {Ast, Def, Rtl}.{vars(), substitution()} and Def.uses(), Def.definitions() - these enable checking structural equivalence between Rtls and doing variable substitutions between compatible Rtls; Add TypeEnv.permits() routine - allows checking if a given TypeEnv allows a given concrete typing without enumerating all typings (will be useful for determing which semantic transform applies to a given concrete typing). 2017-07-24 14:08:44 -07:00
d1m0
a9147ebd30 Add fix for #114 (#115)
* Reduce code duplication in TypeConstraint subclasses; Add ConstrainWiderOrEqual to ti and to ireduce,{s,u}extend and f{promote,demote}; Fix bug in emitting constraint edges in TypeEnv.dot(); Modify runtime constraint checks to reject match when they encounter overflow

* Rename Constrain types to something shorter; Move lane_bits/lane_counts in subclasses of ValueType; Add wider_or_eq function in rust and python;
2017-07-12 08:51:55 -07:00
d1m0
c5cddc3eac Handle bound instructions in pattern type inference (#113) 2017-07-11 08:39:22 -07:00
d1m0
98f822f347 Emit runtime type checks in legalizer.rs (#112)
* Emit runtime type checks in legalizer.rs
2017-07-10 15:28:32 -07:00
d1m0
83e55525d6 Cleanup typos; Remove SAMEAS; More descriptive rank comments; Introduce explicit sorting in free_typevars() (#111)
As per the comment in TypeEnv.normalize_tv about cancellation, whenever we create a TypeVar we must assert that there is no under/overflow. To make sure this always happen move the safety checks to TypeVar.derived() from the other helper methods
2017-07-05 15:47:44 -07:00
d1m0
a5c96ef6bf Add better type inference and encapsulate it in its own file (#110)
* Add more rigorous type inference and encapsulate the type inferece code in its own file (ti.py).

Add constraints accumulation during type inference, to represent constraints that cannot be expressed
using bijective derivation functions between typevars.

Add testing for new type inference code.

* Additional annotations to appease mypy
2017-07-05 09:16:44 -07:00