Since SSA has two requirements:
- Every variable is assigned exactly once
- Every variable is defined before it is used
Phi function of a loop may be like this:
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
In this phi function,
%indvars.iv.next appears before it is generated. Does it violate SSA form?
In my opinion, it only appears before it is defined, but it is not used (in the first iteration) before it is generated and therefore this phi function complies with SSA form.
Is this explanation correct?