[LLVMdev] prevent frontend from emitting i64

Ruiling Song ruiling.song83 at gmail.com
Fri Jan 30 00:58:02 PST 2015


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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150130/9bd06f96/attachment.html>


More information about the llvm-dev mailing list