[LLVMdev] Helping the optimizer along (__assume)
Duncan Sands
baldrick at free.fr
Thu Oct 23 05:30:58 PDT 2008
Hi,
> * Mark the instructions used for assumptions explicitely, so they won't get
> modified, i.e.:
>
> %cond = icmp ne i32 %p, 0
> call void @llvm.assume( i1 %cond )
gcc uses the equivalent of:
%p2 = call @llvm.assume(i32 %p, "ne", i32 0)
with %p2 being used for %p wherever this assumption
if valid (for example in the "true" branch of an
"if (%p != 0) {...}").
Ciao,
Duncan.
More information about the llvm-dev
mailing list