[llvm-commits] [llvm] r166865 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Duncan Sands baldrick at free.fr
Mon Oct 29 09:52:55 PDT 2012


Hi Hal,

>> does this mean you are querying target lowering info to get these
>> cost
>> estimates? That doesn't make any sense to me.
>>
>>
>> Yes. We ask TLI if the operation is legal (or custom or promote) or
>> if it is 'expand'. This works in many cases.
>> The idea is to provide a basic cost information for all targets. The
>> cost information that we get is inaccurate, but it gives us a
>> ballpark figure.
>> The next step is to define backend-specific cost model that will give
>> more accurate information.
>>
>>
>>
>> Can't the whole cost
>> estimate thing be its own independent world?
>
> It could be, but then we'd need to maintain two separate sets of target-dependent information,

not necessarily, since codegen could also query this.  For example, the IR
transforms need to know whether a certain vector operation is cheap.  To know
this, you need to know what the target machine is, what features are enabled
etc.  All this could be factored out of codegen into some library/interface that
is shared both by the IR level and by codegen.  As far as I can see this isn't
what is being done, please correct me if I'm wrong.

Ciao, Duncan.

  a lot of which will be redundant. The existing targets already give us 80% of 
what we need (what types are legal, what operations are legal, how these things 
are legalized, etc.), and we get this for all targets without doing any 
additional work. To get beyond legalization costs, target-specific tables and 
code will be needed, and keeping all of the target-dependent code together seems 
like it makes the most sense.
>
> Thanks again,
> Hal
>
>>
>>
>> I don't understand this.
>>
>>
>> In fact it would be nice
>> to have cost information for all targets regardless of whether
>> codegen
>> support for that target is even built (but maybe that's going too
>> far).
>>
>> I agree. This is what I want to get with the default implementation.
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>




More information about the llvm-commits mailing list