[llvm-commits] [llvm] r59756 - /llvm/trunk/include/llvm/Intrinsics.td

Duncan Sands baldrick at free.fr
Fri Nov 21 07:06:58 PST 2008


Hi Bill,

> There are multiple ways to do this already - you named one of them.  
> It's a convenience tool for people who want to act on an overflow. The  
> idea will be that a platform can have its own lowering algorithm that  
> will easily recognize an ADDO and lower it into something simple. For  
> instance:
> 
> 	addl %eax, %ecx
> 	jo overflow

if codegen could be taught to consistently produce this for the corresponding i33
implementation, that would be more general and more powerful (IRBuilder could get
a helper method for producing "check overflow" code, as a convenience for users,
giving the convenience of the intrinsic).  Also, the IR optimizers can potentially
do all kind of simplifications with the i33 version, depending on how it is used
exactly, which is not the case with the intrinsic (unless of course you teach all
kinds of places about it).  That said, having codegen reliably produce perfect code
for the i33 implementation could be quite a job.

> As Chris noted, a "flag" isn't the same as the bool value in the case.  
> The value could be stored or whatever . . .

Sure.  However the i33 version works perfectly well for storing the value too,
as it must (otherwise LegalizeTypes would be buggy - impossible!).

Ciao,

Duncan.



More information about the llvm-commits mailing list