[PATCH] D21271: Fix `InstCombine` to not widen metadata on store-to-load forwarding

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 12 20:48:01 PDT 2016


On Sun, Jun 12, 2016 at 8:03 PM, Yichao Yu via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> yuyichao added a comment.
>
> In another word, IMHO,
>
>   %v1 = load i64, i64 *%p1, !tbaa !0
>   %v2 = load i64, i64 *%p1, !tbaa !1
>
> should be invalid IR (and the optimizer should not be allowed to create
> this) if `!1` and `!2` are non-aliasing tbaa node.

Why?
It's entirely possible to create a language where this is a valid and
useful lowering.
TBAA applies *to the load*, not to the *pointer*, and the langref says
nothing about it requiring it to assign consistent TBAA nodes to different
loads of the same pointer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160612/c469e395/attachment.html>


More information about the llvm-commits mailing list