[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments...
authorChen Li <meloli87@gmail.com>
Mon, 14 Sep 2015 18:10:43 +0000 (18:10 +0000)
committerChen Li <meloli87@gmail.com>
Mon, 14 Sep 2015 18:10:43 +0000 (18:10 +0000)
commitecc1d153b795b9d66529d848225e65c3b6e0b6fb
tree11a6ebfccb6c63e7b4a77ccaae73a70d1228985a
parent2d35348660127118b357c2ac8f0247460243173a
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite

Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of passing arguments at callsite. In this way it can handle cases where the argument does not have nonnull attribute but has a dominating null check from the CFG. It also adds assertions in isKnownNonNull() and isKnownNonNullFromDominatingCondition() to make sure the value checked is pointer type (as defined in LLVM document). These assertions might trip failures in things which are not  covered under llvm/test, but fixes should be pretty obvious.

Reviewers: reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12779

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247587 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/call_nonnull_arg.ll [new file with mode: 0644]