This is an archive of the discontinued LLVM Phabricator instance.

[InterleavedAccess] Return correct 'modified' status.
ClosedPublic

Authored by fhahn on Jan 3 2021, 10:41 AM.

Details

Summary

Both tryReplaceExtracts and replaceBinOpShuffles may modify the IR, even
if no interleaved loads are generated, but currently the pass pretends
no changes were made.

This patch updates the pass to return true if either of the functions
made any changes. In case of tryReplaceExtracts, changes are made if
there are any Extracts and true is returned.

replaceBinOpShuffles always makes changes if BinOpShuffles is not empty.
It also always returned true, so I went ahead and change it to just
replaceBinOpShuffles.

Fixes PR48208.

Diff Detail

Event Timeline

fhahn created this revision.Jan 3 2021, 10:41 AM
fhahn requested review of this revision.Jan 3 2021, 10:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 3 2021, 10:41 AM
SjoerdMeijer added inline comments.Jan 4 2021, 1:08 AM
llvm/lib/CodeGen/InterleavedAccessPass.cpp
383

Bit of a nitpick, but would it make sense to do the return !BinOpShuffles.empty() in replaceBinOpShuffles? Letting that function return a bool is probably more consistent?

fhahn updated this revision to Diff 314367.Jan 4 2021, 5:23 AM

Update replaceBinOpShuffles to return a bool indicating if it made changes.

SjoerdMeijer accepted this revision.Jan 4 2021, 5:30 AM

Cheers, LGTM

This revision is now accepted and ready to land.Jan 4 2021, 5:30 AM
This revision was automatically updated to reflect the committed changes.