Jimborean Alexandra
2012-Nov-22 12:07 UTC
[LLVMdev] Set the minimum number of allocated bits for a variable
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>
Patrik Hägglund H
2012-Nov-22 12:47 UTC
[LLVMdev] Set the minimum number of allocated bits for a variable
Hi Alexandra, I'm not sure want you want to do. Is the data layout string (http://llvm.org/docs/LangRef.html#datalayout, also usually set by each target specific *TargetMachine constructor), for setting the alignment good enough for you? Or is it more than the alignment you want to control? Do you have a target with 16-bit bytes? In that case, there is quite a lot of changes that needs to be done (we maintain some patches internally that we can provide upon request). Regards, Patrik Hägglund From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Jimborean Alexandra Sent: den 22 november 2012 13:07 To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] Set the minimum number of allocated bits for a variable 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/2700a443/attachment.html>
Jimborean Alexandra
2012-Dec-10 17:28 UTC
[LLVMdev] Set the minimum number of allocated bits for a variable
Hello Patrik, Thank you for your reply. Indeed, setting the alignment using the constructor is sufficient. Regards, Alexandra ________________________________ From: Patrik Hägglund H <patrik.h.hagglund at ericsson.com> To: Jimborean Alexandra <xinfinity_a at yahoo.com> Cc: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> Sent: Thursday, November 22, 2012 1:47 PM Subject: RE: [LLVMdev] Set the minimum number of allocated bits for a variable Hi Alexandra, I’m not sure want you want to do. Is the data layout string (http://llvm.org/docs/LangRef.html#datalayout, also usually set by each target specific *TargetMachine constructor), for setting the alignment good enough for you? Or is it more than the alignment you want to control? Do you have a target with 16-bit bytes? In that case, there is quite a lot of changes that needs to be done (we maintain some patches internally that we can provide upon request). Regards, Patrik Hägglund From:llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Jimborean Alexandra Sent: den 22 november 2012 13:07 To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] Set the minimum number of allocated bits for a variable 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/20121210/a51b072b/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Set the minimum number of allocated bits for a variable
- [LLVMdev] speculative parallelization in LLVM
- [LLVMdev] scalar evolution to determine access functions in arays
- [LLVMdev] [cfe-commits] [PATCH] [llvm+clang] memset for non-8-bit bytes
- [LLVMdev] How to call the llvm.prefetch intrinsic ?