[LLVMdev] Evaluating the register allocators

Lang Hames lhames at gmail.com
Mon Mar 10 22:43:45 PDT 2014


Hi Najem,

Regarding your first question, clang does not reference any symbols in
RegAllocPBQP.cpp or RegAllocBasic.cpp, so the corresponding allocators
are not linked in to the clang binary. An easy fix for this, if you
are building your own compiler from source, is to add the following
include directive to cc1_main.cpp:

#include "llvm/CodeGen/LinkAllCodeGenComponents.h"

Once you have re-compiled, you should be able to use '-mllvm
-regalloc=pbqp/basic'.

I hope this helps.

Regards,
Lang.

On Mon, Mar 10, 2014 at 10:37 AM, Andrew Trick <atrick at apple.com> wrote:
>
> On Mar 9, 2014, at 2:15 PM, Najem Eldeen Abu Rmaileh <ermeleh at hotmail.com> wrote:
>
>> Hello,
>>
>> I'm trying to evaluate the different register allocation algorithms on LLVM using the same level of optimizations. Using version 3.3 the current register allocators available to use are "basic, fast, greedy and pbqp". However, I'm facing the following issues:
>>
>> 1) I can't run basic and PBQP allocators using the command line flags of the dragonegg (-fplugin-arg-dragonegg-llvm-option="-regalloc:basic"). I get this error message "for the -regalloc option: Cannot find option named 'pbqp'!" or basic. Note that I didn't get this error when I used the LLC tool.
>>
>> 2) I can't run the fast register allocator while using the "O1/O2/O3" optimizations flags. Is there any purpose behind disabling this pass while the optimizations are enabled?
>
> Regalloc is a pipeline of passes that need to cooperate. If you want to run all the usual llc optimizations with fast regalloc you probably need "-O2 -optimize-regalloc=false"
>
> -Andy
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list