OSDN Git Service

[TableGen] Remove unnecessary TypeSetByHwMode -> ValueTypeByHwMode -> TypeSetByHwMode...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 15 Aug 2018 20:41:19 +0000 (20:41 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 15 Aug 2018 20:41:19 +0000 (20:41 +0000)
commit1cdda230e96625ae9c2181fe134ecb68d6f53f10
tree7cb0d87c287de1c87ae3ed39112a71fb043326f1
parente79e42e6c4d596b8b7108ac0bee13d02252eae0d
[TableGen] Remove unnecessary TypeSetByHwMode -> ValueTypeByHwMode -> TypeSetByHwMode conversions in getPatternSize

I noticed this during profiling of tablegen (PR28222) that we were calling Child->getType(0) which creates a ValueTypeByHwMode on the fly from the requested internal TypeSetByHwMode type and returns it by value, we then treat it as a TypeSetByHwMode reference which involves constructing a new TypeSetByHwMode on the stack with a large amount of std::map iterating/copying all along the way.

I am not an expert on tablegen, but AFAICT this is all unnecessary and we should be calling Child->getExtType(0) which returns the original TypeSetByHwMode by reference.

This gives me a 90sec reduction in msvc debug builds of x86 -gen-dag-isel.

Differential Revision: https://reviews.llvm.org/D50789

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339812 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeGenDAGPatterns.cpp