Matthew Simpson via llvm-dev
2016-Nov-30 19:49 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
That's right. In your example, if the target isn't specified anywhere, an llc invocation would be equivalent to "llc -mtriple=x86_64-unknown-linux-gnu -mcpu=generic". TTI queries (in e.g., CodeGenPrepare) would be based on this. From opt, if the target triple is left unspecified, we will use the "base" TTI implementation (not x86). -- Matt On Wed, Nov 30, 2016 at 2:07 PM, Michael Kuperstein via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Right, let's say what we get from llc --version is: > > Default target: x86_64-unknown-linux-gnu > Host CPU: haswell > > So, what we currently do is use the default target (which is normally the > host target), but ignore the host cpu? > > Michael > > On Wed, Nov 30, 2016 at 10:58 AM, Matthew Simpson <mssimpso at codeaurora.org > > wrote: > >> >> On Wed, Nov 30, 2016 at 1:04 PM, Michael Kuperstein via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >>> So, just to make sure I understand, what is getting a specific TTI in >>> llc triggered off? -mcpu? >> >> >> Right, TTI would be determined by the target specified in the IR or set >> explicitly with the -m flags. My understanding is that if the target is >> left unspecified in the IR and not set with the -m flags, llc will generate >> code for the default target listed in the output of "llc --version". >> >> -- Matt >> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://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/20161130/d7d7df91/attachment.html>
Michael Kuperstein via llvm-dev
2016-Nov-30 19:53 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
Yeah, this makes a lot of sense, -mcpu=generic (as opposed to -mcpu=native) is the sane default. I guess I was just expecting an x86 host to get a "generic x86 TTI" (whatever that means), not a "generic TTI". On Wed, Nov 30, 2016 at 11:49 AM, Matthew Simpson <mssimpso at codeaurora.org> wrote:> That's right. In your example, if the target isn't specified anywhere, an > llc invocation would be equivalent to "llc -mtriple=x86_64-unknown-linux-gnu > -mcpu=generic". TTI queries (in e.g., CodeGenPrepare) would be based on > this. From opt, if the target triple is left unspecified, we will use the > "base" TTI implementation (not x86). > > -- Matt > > On Wed, Nov 30, 2016 at 2:07 PM, Michael Kuperstein via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Right, let's say what we get from llc --version is: >> >> Default target: x86_64-unknown-linux-gnu >> Host CPU: haswell >> >> So, what we currently do is use the default target (which is normally the >> host target), but ignore the host cpu? >> >> Michael >> >> On Wed, Nov 30, 2016 at 10:58 AM, Matthew Simpson < >> mssimpso at codeaurora.org> wrote: >> >>> >>> On Wed, Nov 30, 2016 at 1:04 PM, Michael Kuperstein via llvm-dev < >>> llvm-dev at lists.llvm.org> wrote: >>> >>>> So, just to make sure I understand, what is getting a specific TTI in >>>> llc triggered off? -mcpu? >>> >>> >>> Right, TTI would be determined by the target specified in the IR or set >>> explicitly with the -m flags. My understanding is that if the target is >>> left unspecified in the IR and not set with the -m flags, llc will generate >>> code for the default target listed in the output of "llc --version". >>> >>> -- Matt >>> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://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/20161130/746aa017/attachment.html>
Renato Golin via llvm-dev
2016-Dec-02 16:03 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
On 30 November 2016 at 19:53, Michael Kuperstein via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Yeah, this makes a lot of sense, -mcpu=generic (as opposed to -mcpu=native) > is the sane default. > I guess I was just expecting an x86 host to get a "generic x86 TTI" > (whatever that means), not a "generic TTI".I think using "generic" is the way to go here, but it's still *not* target-independent. -march=x86 -mcpu=generic -> i586? (SSE?) -march=x86_64 -mcpu=generic -> Pentium what? (SSE? AVX?) -march=arm -mcpu=generic -> ARM7TDMI (ARMv4T, no VFP, no NEON) -march=aarch64 -mcpu=generic -> Cortex-A53 (ARMv8, VFP + SIMD) So, if you don't specify -march, but use -mcpu=generic, when you run the tests on native ARM/AArch64, you'll get different results on your target-independent tests if they can support vector code at all. We currently build *only* the ARM back-ends on the ARM native bots because building x86 takes a long time and that's being tested elsewhere. That's why we get a lot of test failing when they expect the x86 back-end to exist (via -march=x86_64). My point is, there is no safe way to do target-independent tests of the vectorizer if you don't force "some" parameters. However, it should be mostly fine, as we don't really need all bots to test all things. If the x86_64 bots are testing the generic IR transformations and the ARM bots are testing the ARM specific ones, we're mostly covered. We may let slip a thing or two in the cost models, but other tests (like self-hosting, test-suite, benchmarks) will eventually pick them up. In this case, we should add a new target-specific test on the ARM side to make sure we don't regress again. Does that make sense? cheers, --renato
Adam Nemet via llvm-dev
2016-Dec-02 17:53 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
Why is llc relevant to this thread, is this just an aside? Target-independent tests for LV are formulated with opt.> On Nov 30, 2016, at 11:53 AM, Michael Kuperstein via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Yeah, this makes a lot of sense, -mcpu=generic (as opposed to -mcpu=native) is the sane default. > I guess I was just expecting an x86 host to get a "generic x86 TTI" (whatever that means), not a "generic TTI". > > On Wed, Nov 30, 2016 at 11:49 AM, Matthew Simpson <mssimpso at codeaurora.org <mailto:mssimpso at codeaurora.org>> wrote: > That's right. In your example, if the target isn't specified anywhere, an llc invocation would be equivalent to "llc -mtriple=x86_64-unknown-linux-gnu -mcpu=generic". TTI queries (in e.g., CodeGenPrepare) would be based on this. From opt, if the target triple is left unspecified, we will use the "base" TTI implementation (not x86). > > -- Matt > > On Wed, Nov 30, 2016 at 2:07 PM, Michael Kuperstein via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > Right, let's say what we get from llc --version is: > > Default target: x86_64-unknown-linux-gnu > Host CPU: haswell > > So, what we currently do is use the default target (which is normally the host target), but ignore the host cpu? > > Michael > > On Wed, Nov 30, 2016 at 10:58 AM, Matthew Simpson <mssimpso at codeaurora.org <mailto:mssimpso at codeaurora.org>> wrote: > > On Wed, Nov 30, 2016 at 1:04 PM, Michael Kuperstein via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > So, just to make sure I understand, what is getting a specific TTI in llc triggered off? -mcpu? > > Right, TTI would be determined by the target specified in the IR or set explicitly with the -m flags. My understanding is that if the target is left unspecified in the IR and not set with the -m flags, llc will generate code for the default target listed in the output of "llc --version". > > -- Matt > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev> > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://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/20161202/a08d6b4b/attachment.html>
Apparently Analagous Threads
- Loop Vectorize: Testing cost model driven transformations
- Loop Vectorize: Testing cost model driven transformations
- Loop Vectorize: Testing cost model driven transformations
- Loop Vectorize: Testing cost model driven transformations
- Loop Vectorize: Testing cost model driven transformations