HomePhabricator

[ubsan] Skip alignment checks on allocas with known alignment

Description

[ubsan] Skip alignment checks on allocas with known alignment

It's possible to determine the alignment of an alloca at compile-time.
Use this information to skip emitting some runtime alignment checks.

Testing: check-clang, check-ubsan.

This significantly reduces the amount of alignment checks we emit when
compiling X86ISelLowering.cpp. Here are the numbers from patched/unpatched
clangs based on r301361.


| Setup          | # of alignment checks |
------------------------------------------
| unpatched, -O0 |                 47195 |
| patched, -O0   |                 30876 | (-34.6%)
------------------------------------------

Details

Committed
vedantkApr 25 2017, 7:17 PM
Parents
rL301376: [XRay][tools] Fixup definition for stat division.
Branches
Unknown
Tags
Unknown