This is an archive of the discontinued LLVM Phabricator instance.

[LoadStoreVectorize] Ignore interleaved invariant loads.
ClosedPublic

Authored by bkramer on Apr 24 2018, 7:10 AM.

Details

Summary

The memory location an invariant load is using can never be clobbered by
any store, so it's safe to move the load ahead of the store.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer created this revision.Apr 24 2018, 7:10 AM
arsenm added a subscriber: arsenm.Apr 24 2018, 7:27 AM

Would it be difficult to preserve the invariant if both loads are?

test/Transforms/LoadStoreVectorizer/AMDGPU/invariant-load.ll
5 ↗(On Diff #143739)

-LABEL for the function.

Should also check that the load is not marked invariant since it's merged with a non-invariant load.

bkramer updated this revision to Diff 143741.Apr 24 2018, 7:43 AM

Improve test by checking that the merged store is not marked as invariant.

bkramer marked an inline comment as done.Apr 24 2018, 7:50 AM

Would it be difficult to preserve the invariant if both loads are?

It already does that by calling into llvm::propagateMetadata

arsenm accepted this revision.Apr 24 2018, 8:19 AM

LGTM

This revision is now accepted and ready to land.Apr 24 2018, 8:19 AM
This revision was automatically updated to reflect the committed changes.