Syed Rafiul Hussain via llvm-dev
2016-Mar-22 01:23 UTC
[llvm-dev] Passing llvm option -mem2reg to clang
I have my own llvm pass which requires mem2reg. It worked fine with opt. However, I was trying to make it work with clang as I needed it to run some spec cpu benchmarks. Is there any way that I can mention mem2reg (PromotePass) pass as a pre-requisite in my own pass's implementation? On Mon, Mar 21, 2016 at 9:01 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:> Hi, > > You can't schedule passes from the command line using clang, only `opt` has this ability (AFAIK). > > If you tell us what is your use-case, we may be able to point you to an alternative solution. > > -- > Mehdi > >> On Mar 21, 2016, at 5:52 PM, Syed Rafiul Hussain via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> Hi, >> >> I was trying to pass llvm option -mem2reg to clang using -mllvm and I >> found the following error: >> >> clang (LLVM option parsing): Unknown command line argument '-mem2reg'. >> Try: 'clang (LLVM option parsing) -help' >> clang (LLVM option parsing): Did you mean '-debug'? >> >> I would appreciate if anyone could help me. >> >> -- >> Syed Rafiul Hussain >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Rafi
Mehdi Amini via llvm-dev
2016-Mar-22 01:26 UTC
[llvm-dev] Passing llvm option -mem2reg to clang
> On Mar 21, 2016, at 6:23 PM, Syed Rafiul Hussain <rafiul1906 at gmail.com> wrote: > > I have my own llvm pass which requires mem2reg. It worked fine with > opt. However, I was trying to make it work with clang as I needed it > to run some spec cpu benchmarks. > > Is there any way that I can mention mem2reg (PromotePass) pass as a > pre-requisite in my own pass's implementation?How are you inserting your pass in the pipeline setup by clang? You should be able to insert mem2reg before the same way. Also mem2reg is ran by clang when optimizations are enabled, depending on what your pass is doing it may be a matter of inserting it at the right place. -- Mehdi> > > On Mon, Mar 21, 2016 at 9:01 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: >> Hi, >> >> You can't schedule passes from the command line using clang, only `opt` has this ability (AFAIK). >> >> If you tell us what is your use-case, we may be able to point you to an alternative solution. >> >> -- >> Mehdi >> >>> On Mar 21, 2016, at 5:52 PM, Syed Rafiul Hussain via llvm-dev <llvm-dev at lists.llvm.org> wrote: >>> >>> Hi, >>> >>> I was trying to pass llvm option -mem2reg to clang using -mllvm and I >>> found the following error: >>> >>> clang (LLVM option parsing): Unknown command line argument '-mem2reg'. >>> Try: 'clang (LLVM option parsing) -help' >>> clang (LLVM option parsing): Did you mean '-debug'? >>> >>> I would appreciate if anyone could help me. >>> >>> -- >>> Syed Rafiul Hussain >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > > > -- > Rafi
Syed Rafiul Hussain via llvm-dev
2016-Mar-22 01:30 UTC
[llvm-dev] Passing llvm option -mem2reg to clang
I have used the following command for my pass (without -mem2reg): clang -Xclang -load -Xclang MYPASS.so -c ../../tests/test1.c For mem2reg, I tried the following: clang -mllvm -mem2reg -Xclang -load -Xclang MYPASS.so -c ../../tests/test1.c On Mon, Mar 21, 2016 at 9:26 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:> >> On Mar 21, 2016, at 6:23 PM, Syed Rafiul Hussain <rafiul1906 at gmail.com> wrote: >> >> I have my own llvm pass which requires mem2reg. It worked fine with >> opt. However, I was trying to make it work with clang as I needed it >> to run some spec cpu benchmarks. >> >> Is there any way that I can mention mem2reg (PromotePass) pass as a >> pre-requisite in my own pass's implementation? > > How are you inserting your pass in the pipeline setup by clang? > You should be able to insert mem2reg before the same way. > Also mem2reg is ran by clang when optimizations are enabled, depending on what your pass is doing it may be a matter of inserting it at the right place. > > -- > Mehdi > > >> >> >> On Mon, Mar 21, 2016 at 9:01 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: >>> Hi, >>> >>> You can't schedule passes from the command line using clang, only `opt` has this ability (AFAIK). >>> >>> If you tell us what is your use-case, we may be able to point you to an alternative solution. >>> >>> -- >>> Mehdi >>> >>>> On Mar 21, 2016, at 5:52 PM, Syed Rafiul Hussain via llvm-dev <llvm-dev at lists.llvm.org> wrote: >>>> >>>> Hi, >>>> >>>> I was trying to pass llvm option -mem2reg to clang using -mllvm and I >>>> found the following error: >>>> >>>> clang (LLVM option parsing): Unknown command line argument '-mem2reg'. >>>> Try: 'clang (LLVM option parsing) -help' >>>> clang (LLVM option parsing): Did you mean '-debug'? >>>> >>>> I would appreciate if anyone could help me. >>>> >>>> -- >>>> Syed Rafiul Hussain >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> llvm-dev at lists.llvm.org >>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>> >> >> >> >> -- >> Rafi >-- Rafi