This is an archive of the discontinued LLVM Phabricator instance.

[Polly] [Fortran Support] [Hack] [WIP] add option to treat function parameters as dereferencable
ClosedPublic

Authored by bollu on Aug 8 2017, 5:08 AM.

Details

Summary

Dragonegg generates most function parameters as pointers to the actual
parameters. However, it does not mark these parameters with the
dereferencable attribute.

Polly is conservative when it comes to invariant load
hoisting, thus we refuse to invariant load hoist when we do not know
that pointers are dereferencable. This is correct behaviour, but is
inconvenient.

Add a flag that allows all pointer parameters to be dereferencable.

Please revert this in 2018.

Diff Detail

Repository
rL LLVM

Event Timeline

bollu created this revision.Aug 8 2017, 5:08 AM
bollu added a comment.Aug 8 2017, 5:09 AM

@grosser - Could you please post the test case for this?

grosser edited edge metadata.Aug 8 2017, 5:42 AM

That's the one I sent you via email yesterday.

bollu updated this revision to Diff 111948.Aug 21 2017, 4:32 AM
  • Update code and add test case.
bollu added a comment.Aug 21 2017, 4:32 AM

@grosser - review please.

grosser accepted this revision.Aug 21 2017, 4:39 AM

Hi Siddharth,

instead of the comment "revert in 2008", can you add a TODO: contribute back to dragonegg, in case it is updated to a recent LLVM.

lib/Analysis/ScopInfo.cpp
3852 ↗(On Diff #111948)

Debug statement

3855 ↗(On Diff #111948)

OK, that looks good to me.

3881 ↗(On Diff #111948)

Unrelated.

This revision is now accepted and ready to land.Aug 21 2017, 4:39 AM
bollu updated this revision to Diff 111950.Aug 21 2017, 4:48 AM
  • [NFC] fix whitespace and debug print

It seems this diff is corrupted in some way. However, your changes look good.

lib/CodeGen/PPCGCodeGeneration.cpp
1384 ↗(On Diff #111950)

Unrelated?

1409 ↗(On Diff #111950)

Unrelated.

bollu updated this revision to Diff 111951.Aug 21 2017, 4:51 AM
bollu marked 2 inline comments as done.
  • [NFC] fix whitespace and debug print (Fix screwed up diff due to rebase).
This revision was automatically updated to reflect the committed changes.