[LLVMdev] Helping the optimizer along (__assume)

Mike Stump mrs at apple.com
Thu Oct 23 08:36:46 PDT 2008

On Oct 22, 2008, at 5:36 PM, Gordon Henriksen wrote:
> Can't you implement __builtin_assume(cond) to codegen to something  
> like:

> 	%cond = i1 ...
> 	br i1 %cond, label %always, label %never
> never:
> 	unreachable
> always:

The thing I don't like about this, is that this has conditional  
branches all over the place, which break up basic blocks, which, if  
you do that, they screw with optimization passes.  The idea would be  
to use a form that doesn't screw with optimization passes as hard.   
Now, I'm just a front end person, so if the backend people like it,  
who am I to say otherwise...

More information about the llvm-dev mailing list