diff options
author | Vedant Kumar <vsk@apple.com> | 2017-04-17 22:26:10 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-04-17 22:26:10 +0000 |
commit | dbbdda4d23c514b7a1f1817d246d58fba0cad783 (patch) | |
tree | 302f28e2afe1a484dc6626fd28b348aef717a92f /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 379d9c1dc6c019eacf851ba1acfaefe8e5f2a587 (diff) | |
download | llvm-dbbdda4d23c514b7a1f1817d246d58fba0cad783.zip llvm-dbbdda4d23c514b7a1f1817d246d58fba0cad783.tar.gz llvm-dbbdda4d23c514b7a1f1817d246d58fba0cad783.tar.bz2 |
[ubsan] Skip null checks if they are constant-folded away
The IR builder can constant-fold null checks if the pointer operand
points to a constant. If the "is-non-null" check is folded away to
"true", don't emit the null check + branch.
Testing: check-clang, check-ubsan.
This slightly reduces the amount of null checks we emit when compiling
X86ISelLowering.cpp. Here are the numbers from patched/unpatched clangs
based on r300371.
-------------------------------------
| Setup | # of null checks |
-------------------------------------
| unpatched, -O0 | 25251 |
| patched, -O0 | 23925 | (-5.3%)
-------------------------------------
llvm-svn: 300509
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions