[LLVMdev] Proposal: intp type

Chris Lattner clattner at apple.com
Wed Nov 11 10:56:28 PST 2009


On Nov 11, 2009, at 10:20 AM, heisenbug wrote:

> On 10 Nov., 15:10, me22 <me22... at gmail.com> wrote:
>> 2009/11/9 Kenneth Uildriks <kenneth... at gmail.com>:
>> 
>> 
>> 
>>> 1. Conversions to/from other integer types: right now, integer type
>>> conversions are always explicity specified as either a trunc, a sext,
>>> or a zext.  Since the size of intp is not known at IR generation time,
>>> you can't know whether a conversion to/from intp truncates or extends.
>> 
>> Now that there are arbitrary-sized integers, couldn't you zext to i256
>> then trunc down again, and later let the folder simplify as
>> appropriate?
> 
> This is not correct, because i256 occupies too much space in
> structures, etc.

If you're storing it in a structure, just cast it back to an i8* and store it as i8*.

-Chris





More information about the llvm-dev mailing list