[LLVMdev] Set the minimum number of allocated bits for a variable

Jimborean Alexandra xinfinity_a at yahoo.com
Thu Nov 22 04:07:23 PST 2012


Hi,

I would like to force the minimum number of bits allocated for a variable in memory to be 16. From what I have seen, i1 is already represented on 8 bits. So, the only change would be to represent i1 and i8 on 16 bits, as all other types already fulfill this condition.

TargetData can help by setting a higher alignment, thus although the type is i1 or i8, the number of allocated bits is 16. 

What is the best approach to impose this?

(i) modifying the back-end of LLVM 
    - where can I find the defaults for specifying the number of allocated bits for each type?
(ii) writing a pass that overwrites these defaults?
   - by asking for an alignment higher than the default

   - one approach is to set a higher alignment for each allocated variable of type i1 or i8, but this means digging inside the arrays, vectors and structures to check the type of each element.

 
Looking forward to receiving your suggestions.


Thank you,
Alexandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121122/1050dd27/attachment.html>


More information about the llvm-dev mailing list