This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Generate TBAA info for 'this' pointers
AbandonedPublic

Authored by kosarev on Oct 20 2017, 12:47 PM.

Details

Reviewers
rjmccall
hfinkel

Diff Detail

Event Timeline

kosarev created this revision.Oct 20 2017, 12:47 PM
rjmccall edited edge metadata.Oct 23 2017, 11:47 PM

AFAIK, this is pointless because that alloca will be trivially eliminated by mem2reg. Am I missing something? Is this important for some sort of consistency check?

Correct, they are eliminated. However, this change makes things a bit easier as we are pursuing undecorated instructions produced by clang. Once they have their TBAA tags, we don't need to guess if it's something trivial for the optimizer. It shouldn't be a problem to keep this as a local patch, though. So I'm fine with either way.

Okay, if this is just for your own checking, I'd rather not take it. It's not a significant compile-time cost, but there's no reason to pay it at all.

hfinkel edited edge metadata.Oct 24 2017, 7:24 AM

Okay, if this is just for your own checking, I'd rather not take it. It's not a significant compile-time cost, but there's no reason to pay it at all.

In that case, can we take it? I'd rather have everything decorated for use by the type sanitizer.

Okay, if this is just for your own checking, I'd rather not take it. It's not a significant compile-time cost, but there's no reason to pay it at all.

In that case, can we take it? I'd rather have everything decorated for use by the type sanitizer.

There will never, ever be an illegal access to this alloca.

Okay, if this is just for your own checking, I'd rather not take it. It's not a significant compile-time cost, but there's no reason to pay it at all.

In that case, can we take it? I'd rather have everything decorated for use by the type sanitizer.

There will never, ever be an illegal access to this alloca.

Never mind, then ;)

Hmm, according to our research such loads constitute about 18% of all loads under -O -Xclang -disable-llvm-passes on the LLVM code base. I wonder, do you think it would be nice to not generate them at all? I mean, provided that necessary changes do not add too much special-case code.

Hmm, according to our research such loads constitute about 18% of all loads under -O -Xclang -disable-llvm-passes on the LLVM code base. I wonder, do you think it would be nice to not generate them at all? I mean, provided that necessary changes do not add too much special-case code.

It would be straightforward to not generate them, but it would create longer live ranges at -O0 and allow 'this' to disappear in debug info, both of which are undesirable.

kosarev abandoned this revision.Oct 26 2017, 5:34 AM

OK, thanks.