Displaying 3 results from an estimated 3 matches for "phi2copy".
2008 Aug 12
0
[LLVMdev] Eliminating gotos
On Aug 12, 2008, at 2:39 AM, Benedict Gaster wrote:
> [bg] Consider the LLVM code:
>
> define i32 @foo(i32 %x, i32 %y) {
> entry:
> %tobool = icmp eq i32 %x, 0 ; <i1> [#uses=1]
> br i1 %tobool, label %ifelse, label %ifthen
>
> ifthen: ; preds = %entry
> %add = add i32 %x, 10 ; <i32> [#uses=1]
> ret i32 %add
>
>
2008 Aug 12
4
[LLVMdev] Eliminating gotos
Hi,
Comments inline.
Ben
On 12/08/2008 03:14, "Owen Anderson" <resistor at mac.com> wrote:
>> We would like to develop a code generator using LLVM for a target language
>> that does not support conditional branches and in fact only supports
>> structured control flow, eg. If and while.
What's the difference between an "if" and a conditional
2008 Aug 12
3
[LLVMdev] Eliminating gotos
...a function call. You'd actually have to add instructions
> to the IR, or come up with a string-based tagging scheme or something
>
> Actually I was thinking something along the following lines:
>
> OpenCL -> LLVM IR
> 2 SSA (mem2reg)
> LLVM optimizations
> 2 !SSA (phi2copy)
> Goto elimination with intrinsics
Code gen (without register allocation and so on)
>
> Where the goto elimination pass would generate something like:
>
> define i32 @foo(i32 %x, i32 %y) {
> entry:
> %tobool = icmp eq i32 %x, 0
>
> %dummy1 =...