[PATCH] D31885: Remove TBAA information from LValues representing union members

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 12:46:30 PDT 2017


rjmccall added a comment.

In https://reviews.llvm.org/D31885#730920, @dberlin wrote:

> Just so i understand: Ignoring everything else (we can't actually make likelyalias work, i think the code in the bugs makes that very clear),


None of the code in the bugs I've seen makes that very clear, but perhaps I just missed the compelling example.

> you also believe we should effectively pessimize every other language that generates correct TBAA info for LLVM  and will now no longer get optimized well because we've decided not to have clang emit TBAA metadata only in the cases where  it actually wants TBAA applied?

Are you under the impression that I'm proposing something new and that TBAA does not currently defer to BasicAA?

Clang really does want TBAA applied to unions.  I want LLVM to know that an access to a float through a union doesn't alias an arbitrary int* argument, even if the union includes an int.

Anyway, TBAA tends to be less important in other languages, which tend to make much stronger non-type-based aliasing assumptions: functional languages assert that values are immutable, Fortran knows that arrays don't alias, Rust knows when references are unique, etc.

John.


Repository:
  rL LLVM

https://reviews.llvm.org/D31885





More information about the cfe-commits mailing list