Proposed Solution
We are given an LLVM IR file as input, along with a Newton specification. The goal is to parse the IR file and for every operation, which includes Newton-defined signals, to perform a dimensionality check. One approach is this: for every basic block, determine the Newton types of the live-in and live-out values, and use them to check the consistency of the operations inside the basic block. The Newton type information is conveyed to LLVM through auto-generated header files, and is used from LLVM with the use of debug metadata.
Describe alternatives you've considered
Another approach is to examine all operations in a top-down way, taking into account the operator precedence. That is, in order to check the dimensionality consistency of an expression ('+' operator), first do a dimensionality check for each of the terms ('*' operator), then for each of the factors ('^' operator/constant), etc.
Proposed Solution We are given an LLVM IR file as input, along with a Newton specification. The goal is to parse the IR file and for every operation, which includes Newton-defined signals, to perform a dimensionality check. One approach is this: for every basic block, determine the Newton types of the live-in and live-out values, and use them to check the consistency of the operations inside the basic block. The Newton type information is conveyed to LLVM through auto-generated header files, and is used from LLVM with the use of debug metadata.
Describe alternatives you've considered Another approach is to examine all operations in a top-down way, taking into account the operator precedence. That is, in order to check the dimensionality consistency of an expression ('+' operator), first do a dimensionality check for each of the terms ('*' operator), then for each of the factors ('^' operator/constant), etc.