diff options
Diffstat (limited to 'content/zettel/3a8a1.md')
-rw-r--r-- | content/zettel/3a8a1.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/content/zettel/3a8a1.md b/content/zettel/3a8a1.md new file mode 100644 index 0000000..aafc677 --- /dev/null +++ b/content/zettel/3a8a1.md @@ -0,0 +1,27 @@ ++++ +title = "Representations of phi functions in CompCertSSA" +author = "Yann Herklotz" +tags = [] +categories = [] +backlinks = ["3a8a"] +forwardlinks = ["3a8a2"] +zettelid = "3a8a1" ++++ + +**Question**: How are phi functions represented, as they have their own +program tree? + +They are represented using their own tree so that these are separate to +the standard RTL instructions, which alleviates the equivalence checking +between SSA and RTL. + +The way that the phi instructions are then executed, is that after a +`Inop` branch, if it is a branching instruction, then the phi +instructions for that block are all executed in parallel, which means +the correct variables are chosen for each destination variable in the +phi instruction. + +The way we know which value to take from the phi node, is that we know +which predecessor we are coming from. So if it's the \$k\$th +predecessor, then we take the \$k\$th index of the phi instruction +arguments. |