Bionic has had __strlen_chk for quite a while; its goal is to catch overflows of unterminated strings.
This CL allows LLVM to optimize that to strlen where appropriate.
Paths
| Differential D74079
[SimplifyLibCalls] Simplify __strlen_chk ClosedPublic Authored by george.burgess.iv on Feb 5 2020, 11:09 AM.
Details
Summary Bionic has had __strlen_chk for quite a while; its goal is to catch overflows of unterminated strings. This CL allows LLVM to optimize that to strlen where appropriate.
Diff Detail
Event Timeline
george.burgess.iv added inline comments.
This revision is now accepted and ready to land.Feb 8 2020, 11:19 AM Closed by commit rGf8c9ceb1ce9c: [SimplifyLibCalls] Add __strlen_chk. (authored by george.burgess.iv). · Explain WhyFeb 8 2020, 12:07 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 243396 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
llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
|
I don't understand this change. Why is this necessary, e.g., why is __strlen_chk different from functions we optimize already?