[PATCH] D34181: MachineInstr: Reason locally about some memory objects before going to AA.

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 11:10:36 PDT 2017


gberry added a comment.

This change is enhancing the alias checking in three different scenarios, one of which is fairly subtle:

1. adding checking for non-Value MMOs
2. adding simple overlap checking for two equal Value MMOs when no AA is available
3. refining simple overlap checking for two equal Value MMOs when AA is available

Item 3 is the subtle one.  The reason this is improving on the regular AA results is because of the way we're constructing the AA query for MMOs with a non-zero offset.  For example, if we're asking about MMOa x[0:3] and MMOb x[4:7], we construct an AA query that instead asks about x[0:3] and x[0:7].  I assume this was done intentionally to avoid having to construct a new GEP for the non-zero offset case, but I don't know that for sure.

It seems like it might be reasonable to split off Item 1 from above into a separate patch and expand the cases it handles.  Specifically, getting it to handle stack references on AArch64 when some are SP based and some are FP based would be interesting.  You should be able to use the PseudoSourceValue::isAliased() to catch this.  You should also be able to write MIR tests that confirm that this allows e.g. more load/store pairing on AArch64.


https://reviews.llvm.org/D34181





More information about the llvm-commits mailing list