Last active
April 26, 2020 08:44
-
-
Save paniq/960c8836112b8bf58250f353da4b2aa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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