[mlir] Add check for value that might be null.
authorjacquesguan <Jianjian.Guan@streamcomputing.com>
Fri, 13 Jan 2023 08:00:21 +0000 (16:00 +0800)
committerjacquesguan <Jianjian.Guan@streamcomputing.com>
Thu, 16 Feb 2023 08:02:35 +0000 (16:02 +0800)
commit86c8ea9ac92221076518586852d13d6a1f414777
tree35cca2266325e65604d6743250d9cf5c463e01ef
parentf62b084e92e0523bc13ac958603db23e0eccad9a
[mlir] Add check for value that might be null.

Because we are generating uninitialized value for no integer type and use `isUninitialized()` to judge if it is valid after https://reviews.llvm.org/rG93f081c896536112e1ca8133991d23cb1134793a, we should check the value before use `getValue` to get it.
Fixes https://github.com/llvm/llvm-project/issues/59984.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D141661
mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
mlir/test/Dialect/Arith/unsigned-when-equivalent.mlir