summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2021-05-13 20:26:50 -0700
committerReid Kleckner <rnk@google.com>2021-05-13 20:26:50 -0700
commitd2f4b7d77828dba831f4b7429a7c970d71eb853b (patch)
tree89e68fc1889dd5499881e525e841e8ace03212e1 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentee23f8b36f2c620f54fe5cbd74cbf930cb67c6fb (diff)
Use enum comparison instead of generated switch/case, NFC
Clang's coverage data for auto-generated switch cases is really, really large. Before this change, when I enable code coverage, SemaDeclAttr.obj is 4.0GB. Naturally, this fails to link. Replacing the RISCV builtin id check with a comparison reduces object file size from 4.0GB to 330MB. Replacing the AArch64 SVE range check reduces the size again down to 17MB, which is reasonable. I think the RISCV switch is larger in coverage data because it uses more levels of macro expansion, while the SVE intrinsics only use one. In any case, please try to avoid switches with 1000+ cases, they usually don't optimize well.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions