[PATCH] D103254: Preserve more MD_mem_parallel_loop_access and MD_access_group in SROA

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 8 17:46:19 PDT 2021


Meinersbur accepted this revision.
Meinersbur added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/test/Transforms/SROA/mem-par-metadata-sroa-cast.ll:8-9
+; CHECK: entry:
+; CHECK: load i32, i32* {{.*}}, !llvm.access.group [[DISTINCT:![0-9]*]]
+; CHECK: load i32, i32* {{.*}}, !llvm.access.group [[DISTINCT]]
+; CHECK: ret void
----------------
mmendell wrote:
> Meinersbur wrote:
> > mmendell wrote:
> > > Meinersbur wrote:
> > > > This tests the `presplitLoadsAndStores` case. Shouldn't it also have split the store?
> > > The store is replaced with:
> > >   %0 = bitcast i32 %X371 to float
> > >   %1 = bitcast i32 %X373 to float
> > > Should I add that to the LIT test?  The important part was the loss of the llvm.access.group from the store
> > The bitcasts belong to the load. I guess SROA determined that the store is dead (stack memory before returning) and removed it. Not an indication of a good test case.
> > 
> > I suggest to make `%PREV` a function pointer so this does not happen. Attach a separate `!llvm.access.group !1` to the store and test it as well. Most other instructions in this function seems to be irrelevant.
> If I make %PREV a function pointer, then the cast isn't done: [[ https://godbolt.org/z/WW1ns51jn  | compiler explorer]]
> I can remove 2 lines (defn and use of %r2) and still get it to fail.  Anything else, and it doesn't generate the sroa_cast/sroa_cast2
OK, I also tried a bit to get SROA to re-emit a store (and therefore test that the store's metadata is preserved), but without success.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103254/new/

https://reviews.llvm.org/D103254



More information about the llvm-commits mailing list