[SimplifyLibCalls] Add __strlen_chk.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Wed, 5 Feb 2020 06:10:39 +0000 (22:10 -0800)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Sat, 8 Feb 2020 19:51:00 +0000 (11:51 -0800)
commitf8c9ceb1ce9c71574d413a6391812d46d9f9edb3
tree5a9b5b8e61707ee1c6014620196f46016547d0b0
parenta148b9e9909db6a592609eb35b4de38c9e67cb8b
[SimplifyLibCalls] Add __strlen_chk.

Bionic has had `__strlen_chk` for a while. Optimizing that into a
constant is quite profitable, when possible.

Differential Revision: https://reviews.llvm.org/D74079
llvm/include/llvm/Analysis/TargetLibraryInfo.def
llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/strlen_chk.ll [new file with mode: 0644]
llvm/unittests/Analysis/TargetLibraryInfoTest.cpp