[jit][llvm] Track variable nullness separately from array length ranges/index ranges in abcrem. (mono/mono#16499)
* [jit][llvm] Track variable nullness separately from array length ranges/index ranges in abcrem.
"Nullness" is tracked via a separate field that is stored adjacent
variable/array value ranges; values may be "maybe-null" or "not-null";
the intersection of maybe-null and not-null yields not-null, the union of
maybe-null and not-null yields maybe-null. The existing graph traversal logic
is reused as much as possible, which makes the implementation of this
null value approximation slightly more complicated than it would be
otherwise.
Fixes https://github.com/mono/mono/issues/16310, which was caused by
the use of non-empty array length ranges as a way to encode non-null
values.
This also allows null check elision for zero-sized arrays.
* Fix C++ compatibility. Fix a typo in a comment.
* Add symmetric nullness relations.
* Make ldlen imply that the source register is not-null, similar to CHECK_THIS or any other null check.
Commit migrated from https://github.com/mono/mono/commit/
b4886817efcb1825b6dad38ef6cf3999563b3581