This is an archive of the discontinued LLVM Phabricator instance.

[MemCpyOptimizer] Simplify API of processStore and processMem* functions
ClosedPublic

Authored by foad on Jun 10 2020, 1:29 AM.

Details

Summary

Previously these functions either returned a "changed" flag or a "repeat
instruction" flag, and could also modify an iterator to control which
instruction would be processed next.

Simplify this by always returning a "changed" flag, and handling all of
the "repeat instruction" functionality by modifying the iterator.

No functional change intended except in this case:
// If the source and destination of the memcpy are the same, then zap it.
... where the previous code failed to process the instruction after the
zapped memcpy.

Diff Detail

Event Timeline

foad created this revision.Jun 10 2020, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2020, 1:29 AM

I really like this cleanup step, thanks!

This revision is now accepted and ready to land.Jun 10 2020, 4:49 AM
This revision was automatically updated to reflect the committed changes.