<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Tim,<div class=""><br class=""></div><div class="">I have implemented all the steps to register a target backend for LLVM and so far I’m doing ok with it, but I do not know how to select a particular target on Clang. I just modified the “TargetInfo.cpp” file as I posted on my previous email to get 16 bit ints. So, any more insights will be appreciated.</div><div class=""><br class=""></div><div class="">On the other hand I’m unable to find LargeArrayMinSize in any project files (not even in lib/Basic/Targets/X86.cpp) and LargeArrayAlign is only in TargetInfo.h and TargetInfo.cpp which is set to a value of 0 (Zero)</div><div class=""><br class=""></div><div class="">I'm on version 7.0.1,</div><div class=""><br class=""></div><div class="">What am I missing?</div><div class=""><div class=""><br class=""></div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Joan Lluch<br class=""><br class="">Tel: 620 28 45 13</div></div></div>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On 5 May 2019, at 18:22, Tim Northover <<a href="mailto:t.p.northover@gmail.com" class="">t.p.northover@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Joan,<br class=""><br class="">On Sun, 5 May 2019 at 17:09, Joan Lluch via llvm-dev<br class=""><<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""><blockquote type="cite" class="">this gets converted by Clang into this:<br class=""><br class=""> %localBuff = alloca [20 x i8], align 16<br class=""> %localBuff2 = alloca [6 x i8], align 1<br class=""></blockquote><br class="">Is that when Clang is compiling for your target, or maybe you copied<br class="">x86 code into your target?<br class=""><br class="">Because this ought to be controlled by "LargeArrayMinSize" and<br class="">"LargeArrayAlign" in lib/Basic/Targets/XYZ.cpp, and only x86 and<br class="">WebAssembly seem to set the value to 16. The default never increases<br class="">the alignment as far as I can tell.<br class=""><br class=""><blockquote type="cite" class="">- Otherwise, is there a way to override that alignment on the LLVM backend implementation, particularly to get it create frame index offsets aligned by a smaller size, thus ignoring the clang specified alignment?<br class=""></blockquote><br class="">I don't think it's the kind of thing you can (or should) override in<br class="">the backend. Other bits of code could have been relying on it from the<br class="">start (e.g. to store 3 bits of whatever in the low part of a pointer),<br class="">and earlier optimizations might have made even more assumptions based<br class="">on that value.<br class=""><br class="">Cheers.<br class=""><br class="">Tim.<br class=""></div></div></blockquote></div><br class=""></div></div></div></body></html>