Michael Kuperstein via llvm-dev
2016-Dec-02 18:30 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
It isn't relevant, really, Matt just brought up "llc --version" as a way to show the default triple and native cpu. The same question ("Which TTI do/should we get with -mcpu=generic / when not providing -mcpu at all") applies to opt. On Fri, Dec 2, 2016 at 9:53 AM, Adam Nemet <anemet at apple.com> wrote:> 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 > > 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 >>> >>> >> > _______________________________________________ > 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/590e4ac0/attachment.html>
Matthew Simpson via llvm-dev
2016-Dec-02 19:06 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
On Fri, Dec 2, 2016 at 1:30 PM, Michael Kuperstein via llvm-dev < llvm-dev at lists.llvm.org> wrote:> It isn't relevant, really, Matt just brought up "llc --version" as a way > to show the default triple and native cpu. > The same question ("Which TTI do/should we get with -mcpu=generic / when > not providing -mcpu at all") applies to opt. >And just to be clear in case there was any confusion, in opt when a target is not specified we get the generic TTI, not one for the host or default triple indicated by llc. I think this was Adam's original point/question. As long as the tests we want to remain target-independent don't specify a target triple, we should get the same generic TTI on any host. -- Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161202/9739177b/attachment.html>
Adam Nemet via llvm-dev
2016-Dec-02 19:12 UTC
[llvm-dev] Loop Vectorize: Testing cost model driven transformations
> On Dec 2, 2016, at 11:06 AM, Matthew Simpson <mssimpso at codeaurora.org> wrote: > > > On Fri, Dec 2, 2016 at 1:30 PM, Michael Kuperstein via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > It isn't relevant, really, Matt just brought up "llc --version" as a way to show the default triple and native cpu. > The same question ("Which TTI do/should we get with -mcpu=generic / when not providing -mcpu at all") applies to opt. > > And just to be clear in case there was any confusion, in opt when a target is not specified we get the generic TTI, not one for the host or default triple indicated by llc. I think this was Adam's original point/question. As long as the tests we want to remain target-independent don't specify a target triple, we should get the same generic TTI on any host.Yes opt an llc are completely different in this regard. llc always needs a target to generate code for. opt does not, it uses data layout and TTI (the default if not target is specified). That is why I think bringing llc into the discussion was confusing, at least I think it confused Renato. My whole point was that you can write target-independent tests with *opt* but not with llc of course (which I think was Renato’s conclusion). Adam> > -- Matt-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161202/7931d478/attachment.html>