[llvm-dev] Do LLVM passes have different behavior depending on the target triple and/or the optimization level selected?
Michael Kuperstein via llvm-dev
llvm-dev at lists.llvm.org
Tue May 10 10:41:56 PDT 2016
Yes, the optimizer's behavior can, and does, change depending on the target
triple, so you definitely need to pass the target triple to the optimizer
Furthermore, even your frontend will often care about the triple (for a
simple example, consider sizeof in C). So you really ought to use the same
triple through the entire compilation process.
On Tue, May 10, 2016 at 10:21 AM, Ricardo Nobre via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Hi again,
> Thanks for answering my previous question :)
> There is something else I do not understand about the passes in LLVM.
> Does the behavior of some LLVM passes change depending on the 'target
> triple' passed (either inside the LLVM IR or passed as command line
> parameter) to the LLVM Optimizer (LLVM 'opt' tool)?
> Is the behavior of the passes when called by LLVM 'opt' target specific
> (architecture/subarchitecture, vendor, operating system, etc...)?
> If that is the case, then when I'm cross-compiling for a given target
> (e.g., target SPARC-ELF on a X86-LINUX machine) I must always pass the
> target triple.
> If that is not the case, they I only need to pass the target triple to the
> 'llc' static compiler when gerating the assembly code for the target
> Additionally, someone pointed me to this commit, suggesting that the
> behavior of some passes depends on the selected optimization level.
> Is this correct?
> If so, is it possible to execute only some of the passes in -O2 (or in a
> different order), but have them individually behaving as if -O2 was being
> Is there any direct mechanism to control compiler passes individually?
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev