HomePhabricator

Avoid std::map&vector in hexagon builtin code to save code size

Description

Avoid std::map&vector in hexagon builtin code to save code size

Constructing a global std::map requires clang to generate a linear
amount of code to construct the initializer list if the elements are not
constexpr-constructible. std::vector is not constexpr-constructible, so
this code pattern was generating large amounts of code.

Also, because of PR38829, LLVM is pathologically slow on large basic
blocks, and this causes slow compilation. This works around the bug and
reduces code size.

SemaChecking.cpp -debug-info-kind=limited:

time      objsize

before: 1m45.023s 9.8M
after: 0m25.205s 6.9M

So, a 42% obj size reduction and 3.2x speedup.

Details

Committed
rnkOct 25 2018, 3:37 PM
Parents
rC345328: Avoid STMT_ and DECL_ bitcodes overlapping.
Branches
Unknown
Tags
Unknown