This is an archive of the discontinued LLVM Phabricator instance.

Add ExternalAAWrapperPass to createLegacyPMAAResults.
ClosedPublic

Authored by sheredom on Dec 11 2019, 5:27 AM.

Details

Summary

Our out-of-tree custom aliasing solution for the HPC# Burst compiler here at Unity makes use of the ExternalAAWrapperPass infrastructure to insert our custom aliasing resolution into the core of LLVM. This is great for all cases except for function inlining, where because createLegacyPMAAResults does not make use of ExternalAAWrapperPass, when we have a definite no-alias result within a function that won't be propagated to the calling function during inlining.

This commit just rectifies this oversight by adding the missing dependency.

I wasn't sure how to test this given that the only in-tree user of the ExternalAAWrapperPass infrastructure is the AMDGPU backend - I'd appreciate guidance on that facet of this change.

Diff Detail

Event Timeline

sheredom created this revision.Dec 11 2019, 5:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2019, 5:27 AM

@nhaehnle just added you so that you are aware of this change - it in theory could minorly change codegen on AMDGPU but I think you don't actually return any more precise noaliasing state so it should (tm) be fine. But thought it was worth you oking this either way!

@nhaehnle just added you so that you are aware of this change - it in theory could minorly change codegen on AMDGPU but I think you don't actually return any more precise noaliasing state so it should (tm) be fine. But thought it was worth you oking this either way!

Why would it change the AMDGPU backend? It looks like the AMDGPU backend does provide additional pointsToConstantMemory information via its AA implementation.

@nhaehnle just added you so that you are aware of this change - it in theory could minorly change codegen on AMDGPU but I think you don't actually return any more precise noaliasing state so it should (tm) be fine. But thought it was worth you oking this either way!

Why would it change the AMDGPU backend? It looks like the AMDGPU backend does provide additional pointsToConstantMemory information via its AA implementation.

Yeah I'm pretty sure it won't - but you never know whether they had any additional stuff forked internally that this could affect, so felt it was better to make them aware!

Thanks for the heads-up. I think this is perfectly fine from an AMDGPU perspective. It also seems like a simple oversight that the ExternalAAWrapperPass is not in that list, so this LGTM in general, but I'd wait a bit for somebody who is more familiar with alias analysis to weigh in.

llvm/lib/Analysis/AliasAnalysis.cpp
875–877

I don't feel very strongly about it, but IMO it's generally preferable to have braces around multi-line statements.

hfinkel accepted this revision.Dec 13 2019, 5:47 AM

Thanks for the heads-up. I think this is perfectly fine from an AMDGPU perspective. It also seems like a simple oversight that the ExternalAAWrapperPass is not in that list, so this LGTM in general, but I'd wait a bit for somebody who is more familiar with alias analysis to weigh in.

LGTM too.

This revision is now accepted and ready to land.Dec 13 2019, 5:47 AM
This revision was automatically updated to reflect the committed changes.