Closed clementval closed 6 years ago
thanks for the feedback @clementval , some comments from my side:
double a[4]; ->VarDecl
a[2] = 0.0; ->VarAccess
This was intentional, since for i+1
we should use FieldDecl
ParallelDimensions (Dimension+)
et GridDimensions (Dimension+)
nothingplusExpr
, minusExpr
... We are not limited in the numebr of element so for me this is not a reason to not have a precise IR.VarAccess
? Not sure we don't need more flexibilityThe root node Program
should also have several other attributes like the version
of the HIR. It will probably evolve over time and front-end will generate a specific version. With an attribute, the toolchain can check whether the version is supported or outdated.
I agree with 1, 3 and the Program element, but I didnt understand your comment on 2 & 5 (we can discuss it) And for 4, I dont see what else we might need.
I think we are ok then for the small changes. I'll prepare a PR with these changes.
Literal
GridDimension
is empty so I was wondering if it is not missing smth. @cosunae I think we should move forward with the changes we agreed after discussion. I can make them and make a PR for review... Would that be fine with you?
that would be great @clementval
thanks for pushing this
Done with #7
This is a placeholder for my feedback/review. If any changes are simple, I'll directly issue a PR.
1) - [x] named element: As a general comment, I would remove the notion of named elements as it appears now. I think this is quite confusing and it would be more straightforward to have the element with the correct name directly. The elements can then share their internal specification but it would be clear from the beginning. This is the case for example of
lhs
/rhs
. This would remove also the ambiguity with the actual name (in fact identifier) of variables in the IR. Another example can be found in the example. Thevararg
name forVarDecl
is used directly as element name can imply directly the attributeisarg=true
.2) - [x] id instead of name: Following the previous comment, I would change the
name
inVarDecl
and other element representing the variable inid
which is more representative of what the information in the IR is.3) - [x] Literal: Wouldn't it make sense to have the differentiation between String literal and integer/real constant? How do you make the difference otherwise between a string
"1.0"
and an actual real1.0
?4) - [x] binary op: Similar to named elements, I would directly have the operation as the name of the element and not as an attribute.
DivOp
,MulOp
,AddOp
,SubOp
,PowerOp
... Doesn^t matter then if they are all derived from a singleBinaryOp
. This would make the IR more readable.5) - [x] VarAccess: How can we access a var with
i+1
for example. The current specification acceptsLiteral
elements only. I guess it should accept a restricted set ofExprModel
.6) - [x] GridDimension: I think this element is not well defined. It as no content model but should have something like
(Literal+)
or(Var+)
...7) - [x] Program: The content model is referencing
Dimension
but should beGridDimension
. Can be related with 1.WORK IN PROGRESS...
Open PRs: Removal of
Stmt
andExprStmt
as elements #1