[ValueTracking] Guaranteed not to be undef if has dereferenceable attribute
authorluxufan <luxufan@iscas.ac.cn>
Thu, 27 Apr 2023 02:40:27 +0000 (10:40 +0800)
committerluxufan <luxufan@iscas.ac.cn>
Thu, 27 Apr 2023 03:05:49 +0000 (11:05 +0800)
commitb12a2fc4e82424bb940e9250e469abdcce3547f9
tree2d829ce075e7fae951c6559396e7c0e773043df1
parentfd85a6df1d9336601207a80ea65502d86c78f750
[ValueTracking] Guaranteed not to be undef if has dereferenceable attribute

As LangRef says, "dereferenceable<n> implies noundef".
`isGuaranteedNotToBeUndefOrPoison` should return true if the parameter
has dereferenceable attribute.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D149035
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/Attributor/dereferenceable-1.ll
llvm/test/Transforms/Attributor/nocapture-1.ll
llvm/test/Transforms/Attributor/nocapture-2.ll
llvm/test/Transforms/Attributor/nonnull.ll