This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Generate TBAA info for reference loads
ClosedPublic

Authored by kosarev on Oct 23 2017, 1:12 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

kosarev created this revision.Oct 23 2017, 1:12 AM
kosarev added inline comments.Oct 23 2017, 1:17 AM
test/CodeGen/tbaa-reference.cpp
1 ↗(On Diff #119816)

Changes for this test look somewhat complicated, so here's a short summary:

  • We now test loading of reference parameter in B::B() and the constructor itself got an out-of-line definition, so we don't need the foo() function anymore. B::bar() is removed for the same reason.
  • Added method B::get() to check that we load member references properly.
rjmccall added inline comments.Oct 23 2017, 11:51 PM
lib/CodeGen/CGExpr.cpp
2171 ↗(On Diff #119816)

"Pointee" would be better than "Referencee", please.

Should this just take an LValue? The first five arguments here are basically an LValue.

kosarev updated this revision to Diff 120428.Oct 26 2017, 9:06 AM
  • Referencee's renamed to pointee's.
  • EmitLoadOfReference() and EmitLoadOfReferenceLValue() reworked to take reference lvalues.
rjmccall accepted this revision.Oct 26 2017, 1:11 PM

LGTM.

This revision is now accepted and ready to land.Oct 26 2017, 1:11 PM
kosarev added inline comments.Oct 27 2017, 11:03 AM
lib/CodeGen/CGOpenMPRuntime.cpp
1041 ↗(On Diff #120428)

Oh-oh, it looks I do something not functionally equivalent here. Sorry, will update in a moment.

kosarev updated this revision to Diff 120654.Oct 27 2017, 11:04 AM
  • Fixed the type of the reference lvalue in loadToBegin().

John, can you please review the fix? Thanks.

kosarev requested review of this revision.Oct 27 2017, 12:34 PM
kosarev edited edge metadata.
rjmccall accepted this revision.Oct 29 2017, 11:35 PM

Looks good; sorry for not catching that, either.

This revision is now accepted and ready to land.Oct 29 2017, 11:35 PM
This revision was automatically updated to reflect the committed changes.