[Local] Use most generic range if K does not dominate J or K doesn't have a !noundef
authorluxufan <luxufan@iscas.ac.cn>
Thu, 23 Mar 2023 11:31:29 +0000 (19:31 +0800)
committerluxufan <luxufan@iscas.ac.cn>
Thu, 23 Mar 2023 11:31:55 +0000 (19:31 +0800)
commitf44c7dec67fee8a41450c8a46d9e944f88f82eb6
treec74fb089a58306c1f120ac8f694c976a8ec6e995
parent20725d34b29ff2881ecc1d2a5b8a796e2996c313
[Local] Use most generic range if K does not dominate J or K doesn't have a !noundef

Since D141386 has changed the return value of !range from IUB to poison,
metadata !range shouldn't be preserved even if K dominates J.

If this patch was accepted, I plan to adjust metadata !nonnull as well.
BTW, I found that metadata !noundef is not handled in combineMetadata,
is this intentional?

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D142687
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/GVN/range.ll
llvm/test/Transforms/JumpThreading/thread-loads.ll
llvm/test/Transforms/NewGVN/range.ll