DaphneDSL supports the elementwise additive inverse through the typical unary minus operator:
X = [1.1, 2.2, 3.3];
print(-X);
Internally, this operation is represented as a EwMinusOp in DaphneIR.
Task: This task is to add typical simplifications of this operation to the DAPHNE compiler, such as:
Constant folding: Expressions like -123 could be evaluated at compile-time.
Static rewrites: E.g., --x to x.
Overall, such simplications can make the IR simpler and more readable, unlock further simplifications of consuming operations, and reduce the computational effort at run-time.
DaphneDSL supports the elementwise additive inverse through the typical unary minus operator:
Internally, this operation is represented as a
EwMinusOp
in DaphneIR.Task: This task is to add typical simplifications of this operation to the DAPHNE compiler, such as:
-123
could be evaluated at compile-time.--x
tox
.Overall, such simplications can make the IR simpler and more readable, unlock further simplifications of consuming operations, and reduce the computational effort at run-time.
Hints:
src/ir/daphneir/DaphneDialect.cpp
.