Henning Thielemann via llvm-dev
2016-May-01 12:21 UTC
[llvm-dev] basic blocks with input and output parameters instead of phis
I always found the phi instruction pretty unintuitive, because 1. I thought that due to the SSA form the register uniquely determines the basic block and thus the phi instruction should not need the information of a "predecessor block". 2. I remember to have seen valid LL files where the predecessor block in a phi instruction was not an immediate predecessor. I thought that it would be more intuitive to have input and output parameters in basic blocks like so: start: param (i32 %0, i1 %1) ... br i1 %1, label start (%2, %3), label stop (%4) stop: param (i16 %5) ... Has anybody thought about such a structure, yet?
Jeremy Lakeman via llvm-dev
2016-May-01 15:00 UTC
[llvm-dev] basic blocks with input and output parameters instead of phis
Swift's IR does this; https://gist.github.com/modocache/0b688175ca77cebc46f8#file-fibonacci-sil-ll Designed and implemented by some of the same people that designed llvm & clang. On Sun, May 1, 2016 at 9:51 PM, Henning Thielemann via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > I always found the phi instruction pretty unintuitive, because > > 1. I thought that due to the SSA form the register uniquely determines the > basic block and thus the phi instruction should not need the information of > a "predecessor block". > > 2. I remember to have seen valid LL files where the predecessor block in a > phi instruction was not an immediate predecessor. > > > I thought that it would be more intuitive to have input and output > parameters in basic blocks like so: > > start: param (i32 %0, i1 %1) > ... > br i1 %1, label start (%2, %3), label stop (%4) > > stop: param (i16 %5) > ... > > > Has anybody thought about such a structure, yet? > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev