[Analysis] Centralize objectsize lowering logic.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 20 Dec 2016 23:46:36 +0000 (23:46 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 20 Dec 2016 23:46:36 +0000 (23:46 +0000)
commit3f08914e7e58d195818f38f396b9550a7d896ea9
treea727a581aaa563a7a076f66cf3bab96ed61e18c9
parente52614b5c7c25d4b674aa304b6a6e18c1d201c2e
[Analysis] Centralize objectsize lowering logic.

We're currently doing nearly the same thing for @llvm.objectsize in
three different places: two of them are missing checks for overflow,
and one of them could subtly break if InstCombine gets much smarter
about removing alloc sites. Seems like a good idea to not do that.

llvm-svn: 290214
llvm/include/llvm/Analysis/MemoryBuiltins.h
llvm/lib/Analysis/MemoryBuiltins.cpp
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/CodeGenPrepare/builtin-condition.ll