[ADIC] #54: clean up XAIFTraverse to cover expressions and handle in particular assigments separately
#54: clean up XAIFTraverse to cover expressions and handle in particular assigments separately -----------------------------+---------------------------------------------- Reporter: utke | Owner: narayanan Type: task | Status: new Priority: major | Milestone: Component: OA/Sage to XAIF | Version: Keywords: | -----------------------------+---------------------------------------------- this should allow for a cleaner logic by having only one stack of expressions for dealing with expressions nested in variable references as the target to which SgNodes are added during the traversal. Right now the distinction of assignment LHSs and RHSs requires strange logic and code duplication. -- Ticket URL: <http://trac.mcs.anl.gov/projects/ADIC/ticket/54> ADIC <http://trac.mcs.anl.gov/projects/ADIC> ADIC: Automatic Differentiation for C and C++
#54: clean up XAIFTraverse to cover expressions and handle in particular assigments separately -----------------------------+---------------------------------------------- Reporter: utke | Owner: narayanan Type: task | Status: new Priority: major | Milestone: Component: OA/Sage to XAIF | Version: Keywords: | -----------------------------+---------------------------------------------- Comment(by utke): Some notes: There is no representation in the xaif for assignments in comma expressions because there is no decent way of handling them. The canonicalization phase should resolve comma separated assignments into regular assignments. The nesting of expressions in variable references (e.g. expressions for index computations) can be handled by keeping a stack of expressions (currently a list) New Expressions are pushed to the stack for each node representing an xaif VariableReference during the top down phase and popped and populated during the bottom up phase. Because we assume the bottom up order is the exact inverse of the top down order this should work. -- Ticket URL: <http://trac.mcs.anl.gov/projects/ADIC/ticket/54#comment:1> ADIC <http://trac.mcs.anl.gov/projects/ADIC> ADIC: Automatic Differentiation for C and C++
#54: clean up XAIFTraverse to cover expressions and handle in particular assigments separately -----------------------------+---------------------------------------------- Reporter: utke | Owner: narayanan Type: task | Status: new Priority: major | Milestone: Component: OA/Sage to XAIF | Version: Keywords: | -----------------------------+---------------------------------------------- Comment(by norris): Just to be clear, the canonicalization of comma expressions will produce a sequence of assignment statements in the correct scope so that the value of the right-most expression is assigned to the lhs (if any), e.g.: x = a,b,c; becomes a; b; x = c; -- Ticket URL: <http://trac.mcs.anl.gov/projects/ADIC/ticket/54#comment:2> ADIC <http://trac.mcs.anl.gov/projects/ADIC> ADIC: Automatic Differentiation for C and C++
participants (1)
-
ADIC