This is an archive of the discontinued LLVM Phabricator instance.

TargetTransformInfo: Add addrspacesMayAlias
ClosedPublic

Authored by arsenm on Jun 12 2023, 4:35 AM.

Details

Summary

For some reason we used to only handle address space aliasing through
chaining a target specific AA pass. We need never-fail simple queries
in order to lower memmove intrinsics based purely on the address
spaces.

I also think it would be better if BasicAA checked this, rather than
relying on the target AA passes. Currently we go through the more
expensive AA analyses before getting to the trivial address space
checks.

Diff Detail

Event Timeline

arsenm created this revision.Jun 12 2023, 4:35 AM
arsenm requested review of this revision.Jun 12 2023, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2023, 4:35 AM
Herald added a subscriber: wdng. · View Herald Transcript
nikic added a comment.Jun 12 2023, 6:03 AM

Can we query AA in LowerMemIntrinsics instead?

tra accepted this revision.Jun 12 2023, 11:05 AM
tra added inline comments.
llvm/lib/Target/AMDGPU/AMDGPU.h
461–462

Nit: Now that we don't need to use AliasResult::MayAlias/NoAlias I do not see these macros improving readability over the plain true/false.

If you do prefer to use ASMay/ASNo, just make them const bool.

This revision is now accepted and ready to land.Jun 12 2023, 11:05 AM

Can we query AA in LowerMemIntrinsics instead?

I think that would be inappropriate for lowering. AA is a fuzzy interface with may fail and this is mandatory

Can we query AA in LowerMemIntrinsics instead?

I think that would be inappropriate for lowering. AA is a fuzzy interface with may fail and this is mandatory

Okay, that makes sense.