<div dir="ltr">It's a pretty simple code change to make ExpandLargeIntegers support arbitrary power-of-two max sizes. Please let us know if that would be helpful to you, or send us patches. We plan to propose this pass to upstream once it implements more instructions.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 30, 2015 at 12:58 AM, Ruiling Song <span dir="ltr"><<a href="mailto:ruiling.song83@gmail.com" target="_blank">ruiling.song83@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Generally legalize at IR level is not a good idea.<br>But if you need legalization on IR code, you can check PNaCl project. <a href="https://chromium.googlesource.com/native_client/pnacl-llvm/" target="_blank">https://chromium.googlesource.com/native_client/pnacl-llvm/</a><br></div>The pass is located at:  lib/Transforms/NaCl/ExpandLargeIntegers.cpp<br></div>You need make some change, as the pass split large integer into 64bit integers.<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-01-29 16:06 GMT+08:00 Alon Shaltiel (ashaltie) <span dir="ltr"><<a href="mailto:ashaltie@cisco.com" target="_blank">ashaltie@cisco.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<p dir="ltr">Is it just an optimization pass? Maybe I can cancel it somehow with a flag or by doing some code editing? Can you point me to which passes may do that?</p>
<p dir="ltr">I'm working on editing a backend that can't work with anything larger than 32 bits. Does the legalize stage work on IR code? Maybe i can use that?</p><div><div>
<div class="gmail_quote">On Jan 29, 2015 5:41 AM, Ruiling Song <<a href="mailto:ruiling.song83@gmail.com" target="_blank">ruiling.song83@gmail.com</a>> wrote:<br type="attribution">
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">LLVM contains some optimization pass that will generate instructions operate on i64 or even i128 and more. The upstream backend utilize the legalize stage that can break it into instructions with smaller integer types if the target machine does
 not support that large integer type. There seems no way to prevent clang generate i64 instruction. Are you developing a new backend?<br>
</div>
<div><br>
<div>2015-01-28 17:55 GMT+08:00 Alon Shaltiel (ashaltie) <span dir="ltr">
<<a href="mailto:ashaltie@cisco.com" target="_blank">ashaltie@cisco.com</a>></span>:<br>
<blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>
<div>
<p><span>Hello,<u></u><u></u></span></p>
<p><span>Is there a way to make clang create an IR file that doesn’t use 64 bit integers? My C code doesn’t use any 64bit types but still “clang –c –emit-llvm …” emits code that contains i64’s.<u></u><u></u></span></p>
<p><span><u></u> <u></u></span></p>
<p><span>Thanks,<u></u><u></u></span></p>
<p><span>Alon<u></u><u></u></span></p>
</div>
</div>
</div>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</div></div></div>

</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>