Skip to content

Instantly share code, notes, and snippets.

@paniq
Last active April 26, 2020 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paniq/960c8836112b8bf58250f353da4b2aa2 to your computer and use it in GitHub Desktop.
Save paniq/960c8836112b8bf58250f353da4b2aa2 to your computer and use it in GitHub Desktop.
// classical SSA structure
function (%1 %2)
main:
%3 = icmp %1 %2
condbr %3 branch1 branch2
branch1:
%4 = add %1 %2
br merge
branch2:
%5 = mul %1 %2
br merge
merge:
%6 = phi [branch1, %4] [branch2, %5]
ret %6
// SSAT structure
function (%1 %2)
%3 = icmp %1 %2
%6 = label result:
condbr %3
true-branch
%4 = add %1 %2
merge result %4
false-branch
%5 = mul %1 %2
merge result %5
ret %6
// SSAT structure, when merges are returns
function (%1 %2)
%3 = icmp %1 %2
condbr %3
true-branch
%4 = add %1 %2
ret %4
false-branch
%5 = mul %1 %2
ret %5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment