HomePhabricator

Use enum comparison instead of generated switch/case, NFC

Authored by rnk on May 13 2021, 8:26 PM.

Description

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.

Details

Committed
rnkMay 13 2021, 8:26 PM
Parents
rGee23f8b36f2c: [COFF] Remove a truncation assertion from setRVA
Branches
Unknown
Tags
Unknown