Static single-assignment form
ID: static-single-assignment-form
Static single-assignment form is an intermediate representation in which each named value has one static definition. Repeated source assignments receive different names:
x=1; x=x+2 becomes definitions such as x1=1; x2=x1+2. This makes def-use relationships explicit without requiring a search backward for which assignment supplied a value.At a join in a control-flow graph, a phi node selects the value associated with the edge actually taken. If one branch defines
x1=1 and another defines x2=2, the join defines x3=phi(x1,left; x2,right). The node selects an incoming value, not their arithmetic average. Loop-carried values similarly use entry and back-edge arguments. LLVM specifies that phi instructions occur first in a basic block, with an incoming value for each predecessor.[ref] Static uniqueness concerns program definitions, not the number of times a loop instruction executes. New to topics? Read the docs here!