Make violation of !range, !nonnull and !align metadata return poison instead of causing immediate undefined behavior. This makes the behavior match that of the nonnull and align parameter and return value attributes. The previous behavior can be restored by additionally specifying the !noundef metadata, same as with parameters.
Some benefits of this change are:
- This is needed to fix https://github.com/llvm/llvm-project/issues/59888. Under current semantics, it is illegal to add !range annotations based on known bits. Unless we want to drop that optimization entirely, we need to change the !range semantics.
- This allows preserving range/nonnull/align metadata on speculated loads. !noundef metadata needs to be dropped, but the poison-generating metadata can be retained.
I don't think there are really disadvantages to the change (apart from the need to review and adjust optimizations for the new semantics), as the old behavior is still available via !noundef, so it should be strictly more flexible.