Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.
authorManman Ren <mren@apple.com>
Mon, 18 Mar 2013 21:23:25 +0000 (21:23 +0000)
committerManman Ren <mren@apple.com>
Mon, 18 Mar 2013 21:23:25 +0000 (21:23 +0000)
commit1217112d1167a4c11bcb2ef4471fc66fc4e43cc4
tree35a5a3585461191d77e019cca8f2b789a5f4c2ac
parentc2bc61b00656b573e146ceaff46853819ab2c4f9
Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.

This handles the case where we have an inbounds GEP with alloca as the pointer.
This fixes the regression in PR12750 and rdar://13286434.
Note that we can also fix this by handling some GEP cases in isKnownNonNull.

llvm-svn: 177321
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstSimplify/compare.ll