diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-07 02:08:58 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-07 02:08:58 +0000 |
commit | 80d3e56c738aea996510c5c4435a0aa7b90ccf6f (patch) | |
tree | bdfe72e494dc137e6bd825d105429fd57ee8d109 /clang/lib | |
parent | e483d87bd93d1dc67784492e48e46135ec0b1b09 (diff) | |
download | bcm5719-llvm-80d3e56c738aea996510c5c4435a0aa7b90ccf6f.tar.gz bcm5719-llvm-80d3e56c738aea996510c5c4435a0aa7b90ccf6f.zip |
Add support to ValueTracking for determining that a pointer is non-null
by virtue of inbounds GEPs that preclude a null pointer.
This is a very common pattern in the code generated by std::vector and
other standard library routines which use allocators that test for null
pervasively. This is one step closer to teaching Clang+LLVM to be able
to produce an empty function for:
void f() {
std::vector<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
}
Which is related to getting them to completely fold SmallVector
push_back sequences into constants when inlining and other optimizations
make that a possibility.
llvm-svn: 169573
Diffstat (limited to 'clang/lib')
0 files changed, 0 insertions, 0 deletions