J S via llvm-dev
2019-Mar-23 20:32 UTC
[llvm-dev] Generating object files more efficiently
It is my actual target architecture ________________________________ From: Doerfert, Johannes <jdoerfert at anl.gov> Sent: Saturday, March 23, 2019 1:30 PM To: J S Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I copied "-march=XYZ" from your original email, you have to replace it with your actual target architecture or simply drop it. ________________________________ From: J S <mm92126 at hotmail.com> Sent: Saturday, March 23, 2019 3:26:59 PM To: Doerfert, Johannes Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently Johannes, I tried the last one and it gave me this: error: unknown target CPU 'XYZ' note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64 ________________________________ From: Doerfert, Johannes <jdoerfert at anl.gov> Sent: Saturday, March 23, 2019 1:15 PM To: J S Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I would have guessed: object: clang -c foo.c -o foo.o -march=XYZ shared library: clang -shared foo.c -o foo.so -march=XYZ executable: clang foo.c -o foo -march=XYZ On 03/23, J S via llvm-dev wrote:> Currently I compile my C code in 2 steps in order to generate .o files > > clang -emit-llvm -c foo.c -o foo.bc > llc -march=XYZ foo.bc -filetype=obj > > Is there a way to generate either .o or .elf files in just 1 command? > > Thanks. >> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-devllvm-dev Info Page<https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> lists.llvm.org To see the collection of prior postings to the list, visit the llvm-dev Archives.. Using llvm-dev: To post a message to all the list members, send email to llvm-dev at lists.llvm.org. You can subscribe to the list, or change your existing subscription, in the sections below. -- Johannes Doerfert Researcher Argonne National Laboratory Lemont, IL 60439, USA jdoerfert at anl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190323/12d159a3/attachment.html>
Craig Topper via llvm-dev
2019-Mar-23 20:39 UTC
[llvm-dev] Generating object files more efficiently
I think you need to pass a triple for your target to clang using --target otherwise it will use your host target. ~Craig On Sat, Mar 23, 2019 at 1:32 PM J S via llvm-dev <llvm-dev at lists.llvm.org> wrote:> It is my actual target architecture > ------------------------------ > *From:* Doerfert, Johannes <jdoerfert at anl.gov> > *Sent:* Saturday, March 23, 2019 1:30 PM > *To:* J S > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > > I copied "-march=XYZ" from your original email, > > you have to replace it with your actual target architecture or simply drop > it. > ------------------------------ > *From:* J S <mm92126 at hotmail.com> > *Sent:* Saturday, March 23, 2019 3:26:59 PM > *To:* Doerfert, Johannes > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > > > Johannes, > > > I tried the last one and it gave me this: > > > error: unknown target CPU 'XYZ' > note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, > silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, > westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, > core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, > cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, > athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, > barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, > znver2, > x86-64 > > > ------------------------------ > *From:* Doerfert, Johannes <jdoerfert at anl.gov> > *Sent:* Saturday, March 23, 2019 1:15 PM > *To:* J S > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > I would have guessed: > > object: > clang -c foo.c -o foo.o -march=XYZ > > shared library: > clang -shared foo.c -o foo.so -march=XYZ > > executable: > clang foo.c -o foo -march=XYZ > > > On 03/23, J S via llvm-dev wrote: > > Currently I compile my C code in 2 steps in order to generate .o files > > > > clang -emit-llvm -c foo.c -o foo.bc > > llc -march=XYZ foo.bc -filetype=obj > > > > Is there a way to generate either .o or .elf files in just 1 command? > > > > Thanks. > > > > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > llvm-dev Info Page > <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> > lists.llvm.org > To see the collection of prior postings to the list, visit the llvm-dev > Archives.. Using llvm-dev: To post a message to all the list members, send > email to llvm-dev at lists.llvm.org. You can subscribe to the list, or > change your existing subscription, in the sections below. > > > > -- > > Johannes Doerfert > Researcher > > Argonne National Laboratory > Lemont, IL 60439, USA > > jdoerfert at anl.gov > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190323/ada08657/attachment.html>
Doerfert, Johannes via llvm-dev
2019-Mar-23 20:39 UTC
[llvm-dev] Generating object files more efficiently
Oh, my bad. Idk why llc seems to know that architecture but clang does not. Doesn't make sense to me, sorry. ________________________________ From: J S <mm92126 at hotmail.com> Sent: Saturday, March 23, 2019 3:32:03 PM To: Doerfert, Johannes Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently It is my actual target architecture ________________________________ From: Doerfert, Johannes <jdoerfert at anl.gov> Sent: Saturday, March 23, 2019 1:30 PM To: J S Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I copied "-march=XYZ" from your original email, you have to replace it with your actual target architecture or simply drop it. ________________________________ From: J S <mm92126 at hotmail.com> Sent: Saturday, March 23, 2019 3:26:59 PM To: Doerfert, Johannes Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently Johannes, I tried the last one and it gave me this: error: unknown target CPU 'XYZ' note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64 ________________________________ From: Doerfert, Johannes <jdoerfert at anl.gov> Sent: Saturday, March 23, 2019 1:15 PM To: J S Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I would have guessed: object: clang -c foo.c -o foo.o -march=XYZ shared library: clang -shared foo.c -o foo.so -march=XYZ executable: clang foo.c -o foo -march=XYZ On 03/23, J S via llvm-dev wrote:> Currently I compile my C code in 2 steps in order to generate .o files > > clang -emit-llvm -c foo.c -o foo.bc > llc -march=XYZ foo.bc -filetype=obj > > Is there a way to generate either .o or .elf files in just 1 command? > > Thanks. >> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-devllvm-dev Info Page<https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> lists.llvm.org To see the collection of prior postings to the list, visit the llvm-dev Archives.. Using llvm-dev: To post a message to all the list members, send email to llvm-dev at lists.llvm.org. You can subscribe to the list, or change your existing subscription, in the sections below. -- Johannes Doerfert Researcher Argonne National Laboratory Lemont, IL 60439, USA jdoerfert at anl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190323/88727113/attachment.html>
J S via llvm-dev
2019-Mar-23 21:03 UTC
[llvm-dev] Generating object files more efficiently
Craig, clang --target=XYZ x.c -o foo.elf error: unknown target triple 'XYZ', please use -triple or -arch -triple and -arch didn't work either ________________________________ From: Craig Topper <craig.topper at gmail.com> Sent: Saturday, March 23, 2019 1:39 PM To: J S Cc: Doerfert, Johannes; via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I think you need to pass a triple for your target to clang using --target otherwise it will use your host target. ~Craig On Sat, Mar 23, 2019 at 1:32 PM J S via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: It is my actual target architecture ________________________________ From: Doerfert, Johannes <jdoerfert at anl.gov<mailto:jdoerfert at anl.gov>> Sent: Saturday, March 23, 2019 1:30 PM To: J S Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I copied "-march=XYZ" from your original email, you have to replace it with your actual target architecture or simply drop it. ________________________________ From: J S <mm92126 at hotmail.com<mailto:mm92126 at hotmail.com>> Sent: Saturday, March 23, 2019 3:26:59 PM To: Doerfert, Johannes Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently Johannes, I tried the last one and it gave me this: error: unknown target CPU 'XYZ' note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64 ________________________________ From: Doerfert, Johannes <jdoerfert at anl.gov<mailto:jdoerfert at anl.gov>> Sent: Saturday, March 23, 2019 1:15 PM To: J S Cc: via llvm-dev Subject: Re: [llvm-dev] Generating object files more efficiently I would have guessed: object: clang -c foo.c -o foo.o -march=XYZ shared library: clang -shared foo.c -o foo.so -march=XYZ executable: clang foo.c -o foo -march=XYZ On 03/23, J S via llvm-dev wrote:> Currently I compile my C code in 2 steps in order to generate .o files > > clang -emit-llvm -c foo.c -o foo.bc > llc -march=XYZ foo.bc -filetype=obj > > Is there a way to generate either .o or .elf files in just 1 command? > > Thanks. >> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-devllvm-dev Info Page<https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> lists.llvm.org<http://lists.llvm.org> To see the collection of prior postings to the list, visit the llvm-dev Archives.. Using llvm-dev: To post a message to all the list members, send email to llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>. You can subscribe to the list, or change your existing subscription, in the sections below. -- Johannes Doerfert Researcher Argonne National Laboratory Lemont, IL 60439, USA jdoerfert at anl.gov<mailto:jdoerfert at anl.gov> _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190323/6ac51004/attachment.html>
Craig Topper via llvm-dev
2019-Mar-23 21:06 UTC
[llvm-dev] Generating object files more efficiently
-march for clang and -march for llc do different things unfortunately. -march for clang at least on x86 is the same as -mcpu in llc. Which is an artifact of gcc compatibility. ~Craig On Sat, Mar 23, 2019 at 1:40 PM Doerfert, Johannes via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Oh, my bad. > > > Idk why llc seems to know that architecture but clang does not. > > Doesn't make sense to me, sorry. > ------------------------------ > *From:* J S <mm92126 at hotmail.com> > *Sent:* Saturday, March 23, 2019 3:32:03 PM > *To:* Doerfert, Johannes > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > It is my actual target architecture > ------------------------------ > *From:* Doerfert, Johannes <jdoerfert at anl.gov> > *Sent:* Saturday, March 23, 2019 1:30 PM > *To:* J S > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > > I copied "-march=XYZ" from your original email, > > you have to replace it with your actual target architecture or simply drop > it. > ------------------------------ > *From:* J S <mm92126 at hotmail.com> > *Sent:* Saturday, March 23, 2019 3:26:59 PM > *To:* Doerfert, Johannes > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > > > Johannes, > > > I tried the last one and it gave me this: > > > error: unknown target CPU 'XYZ' > note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, > silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, > westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, > core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, > cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, > athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, > barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, > znver2, > x86-64 > > > ------------------------------ > *From:* Doerfert, Johannes <jdoerfert at anl.gov> > *Sent:* Saturday, March 23, 2019 1:15 PM > *To:* J S > *Cc:* via llvm-dev > *Subject:* Re: [llvm-dev] Generating object files more efficiently > > I would have guessed: > > object: > clang -c foo.c -o foo.o -march=XYZ > > shared library: > clang -shared foo.c -o foo.so -march=XYZ > > executable: > clang foo.c -o foo -march=XYZ > > > On 03/23, J S via llvm-dev wrote: > > Currently I compile my C code in 2 steps in order to generate .o files > > > > clang -emit-llvm -c foo.c -o foo.bc > > llc -march=XYZ foo.bc -filetype=obj > > > > Is there a way to generate either .o or .elf files in just 1 command? > > > > Thanks. > > > > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > llvm-dev Info Page > <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> > lists.llvm.org > To see the collection of prior postings to the list, visit the llvm-dev > Archives.. Using llvm-dev: To post a message to all the list members, send > email to llvm-dev at lists.llvm.org. You can subscribe to the list, or > change your existing subscription, in the sections below. > > > > -- > > Johannes Doerfert > Researcher > > Argonne National Laboratory > Lemont, IL 60439, USA > > jdoerfert at anl.gov > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190323/72905221/attachment.html>