Patrik Hägglund H
2012-Dec-03 21:14 UTC
[LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)
There seems to be quite a few places where the EVT type is used, but the code asserts if the variable/parameter is assigned something else than an MVT. Are there any general objections to replace EVT with MVT in these cases? For example, a quick look at TargetLowering.h give me this list of (member) functions, taking an EVT parameter, that asserts if the argument is not an MVT: getRegClassFor, getRepRegClassFor, getRepRegClassCostFor, setTypeAction, getLoadExtAction, isLoadExtLegal, getTruncStoreAction, isTruncStoreLegal, getIndexedLoadAction, getIndexedStoreAction, getCondCodeAction, getTypeToPromoteTo, addRegisterClass Regards, Patrik Hägglund -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121203/d72ae610/attachment.html>
Chris Lattner
2012-Dec-03 23:45 UTC
[LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)
On Dec 3, 2012, at 1:14 PM, Patrik Hägglund H <patrik.h.hagglund at ericsson.com> wrote:> There seems to be quite a few places where the EVT type is used, but the code asserts if the variable/parameter is assigned something else than an MVT. Are there any general objections to replace EVT with MVT in these cases? > > For example, a quick look at TargetLowering.h give me this list of (member) functions, taking an EVT parameter, that asserts if the argument is not an MVT: > > getRegClassFor, getRepRegClassFor, getRepRegClassCostFor, setTypeAction, getLoadExtAction, isLoadExtLegal, getTruncStoreAction, isTruncStoreLegal, getIndexedLoadAction, getIndexedStoreAction, getCondCodeAction, getTypeToPromoteTo, addRegisterClass >Please do. MVT is cheaper than EVT and conceptually cleaner when dealing with physical machine types. EVT should only be used in parts of the code generator that are "pre-legalization" because they can represent arbitrary IR types. Anything that takes a legal machine type should take an MVT. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121203/b32e085f/attachment.html>
David Chisnall
2012-Dec-05 12:51 UTC
[LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)
On 3 Dec 2012, at 23:45, Chris Lattner wrote:> Please do. MVT is cheaper than EVT and conceptually cleaner when dealing with physical machine types. EVT should only be used in parts of the code generator that are "pre-legalization" because they can represent arbitrary IR types. Anything that takes a legal machine type should take an MVT.A side issue of this is that it is currently relatively hard to add new machine-specific register types. The only way of doing this involves extending MVT, which requires tweaking three files in the (nominally) target-independent parts of the compiler. It would be great if we could simply reserve a (small?) number of MVTs for target-specific legal values. David
Maybe Matching Threads
- [LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)
- [LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)
- [LLVMdev] [RFC] Replacing EVT:s with MVT:s (when possible)
- [LLVMdev] Simpler types in TableGen isel patterns
- [LLVMdev] [PATCH] Replacing EVT:s with MVT:s (when possible)