Displaying 3 results from an estimated 3 matches for "notobool".
Did you mean:
nottobool
2008 Aug 12
0
[LLVMdev] Eliminating gotos
On Aug 11, 2008, at 2:02 PM, Benedict Gaster 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 branch?
> As far as I can tell that the problem with doing this in
2008 Aug 11
3
[LLVMdev] Eliminating gotos
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. As far as I can tell that the
problem with doing this in LLVM today, is that it does not support these
high-level constructs and instead all control flow is implemented as
branches.
It is ³fairly²
2008 Aug 12
4
[LLVMdev] Eliminating gotos
...0]
ret i32 %y
}
We cannot express this as it uses the conditional branch br but applying
goto elimination it is possible to re-write as:
define i32 @foo(i32 %x, i32 %y) {
entry:
%tobool = icmp eq i32 %x, 0
if i1 %tobool
%nottobool = icmp eq i1 %tobool, false
if i1 %notobool
endif
ifthen:
%add = add i32 %x, 10
ret i32 %add
endif
ifelse:
%call = tail call i32 (...)* @bar( )
ret i32 %y
}
Of course, this can be optimized to be:
define i32 @foo(i32 %x, i32 %y) {
entry:
%tobool = icmp eq i32 %x, 0
if i1 %tobool
ifthen:...