Dynamic Constant Math
Adding dynamic constant math to Hercules.
- IR definitions
- Parsing (what syntax do people like for the IR? I used a prefix function notation like +(x, y) but this doesn't necessarily fit well with the syntax of the rest of the IR)
- Type checking
Marked as Draft until I implement Juno code-gen for dynamic constant math.
Merge request reports
Activity
requested review from @rarbore2
assigned to @aaronjc4
added 1 commit
- 660b193e - Implement dynamic constant expression code-gen for Juno
I think the prefix syntax actually does fit well with the IR syntax, where basically everything syntactically is a function func(arg1, arg2, ...). I'm ok with using +, -, *, / in DC math, since that will just be when parsing DCs.
One thing I've been wondering is about whether we need to constrain divides - i.e. we definitely need to add a constraint for every -(a, b) that a >= b, since DCs are non-negative. Nominally, we also need for every /(a, b) that b divides a, but we could also just commit to rounding a/b up or down, depending on whichever is more useful. The use case I'm thinking of is tiling with leftovers on a dimension (i.e. non-trivial strip mining, in which case we'd also need a rem % operator).
Edited by rarbore2added 1 commit
- 29d969f6 - Fixes to dynamic constant generation from Juno
@rarbore2 There are some parts of the new code-gen that need to be fixed to work with the changes to dynamic constants. Do you want to do that now or should I just add a
todo!()
case in those places?It appears to just be one place, in
compile_dynamic_constant
.Edited by Aaron Councilman
added 3 commits
-
29d969f6...cce484b6 - 2 commits from branch
main
- b98e2a33 - Merge branch 'main' into dyn_const_math
-
29d969f6...cce484b6 - 2 commits from branch
added 3 commits
-
614207d1...6f8168f1 - 2 commits from branch
main
- 16cf6452 - Merge branch 'main' into dyn_const_math
-
614207d1...6f8168f1 - 2 commits from branch
mentioned in commit def3de91