[LLVMdev] prevent frontend from emitting i64

JF Bastien jfb at google.com
Sat Jan 31 11:16:25 PST 2015


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.

On Fri, Jan 30, 2015 at 12:58 AM, Ruiling Song <ruiling.song83 at gmail.com>
wrote:

> Generally legalize at IR level is not a good idea.
> But if you need legalization on IR code, you can check PNaCl project.
> https://chromium.googlesource.com/native_client/pnacl-llvm/
> The pass is located at:  lib/Transforms/NaCl/ExpandLargeIntegers.cpp
> You need make some change, as the pass split large integer into 64bit
> integers.
>
> 2015-01-29 16:06 GMT+08:00 Alon Shaltiel (ashaltie) <ashaltie at cisco.com>:
>
>>  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?
>>
>> 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?
>> On Jan 29, 2015 5:41 AM, Ruiling Song <ruiling.song83 at gmail.com> wrote:
>>
>>  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?
>>
>> 2015-01-28 17:55 GMT+08:00 Alon Shaltiel (ashaltie) <ashaltie at cisco.com>:
>>
>>   Hello,
>>
>> 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.
>>
>>
>>
>> Thanks,
>>
>> Alon
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150131/180b52a7/attachment.html>


More information about the llvm-dev mailing list