This is an archive of the discontinued LLVM Phabricator instance.

[MemCpyOpt] Insert memset after memcpy in processMemSetMemCpyDependence
AbandonedPublic

Authored by bjope on Oct 11 2022, 2:24 AM.

Details

Reviewers
fhahn
Summary

Code comments in processMemSetMemCpyDependence indicated that
the memset would be sunk below the memcpy when being rewritten. That
was however not true as the code actually inserted the MemSet before
the MemCpy. This patch updates the transform to actully insert the
MemSet after the MemCpy.

While being at it, this patch also make sure that the new memset is
reusing the debug location from the old memset rather than taking
the debug location of the memcpy.

Diff Detail

Event Timeline

bjope created this revision.Oct 11 2022, 2:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 2:24 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
bjope requested review of this revision.Oct 11 2022, 2:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 2:24 AM
bjope added a reviewer: fhahn.Nov 1 2022, 11:59 AM

I guess we either want to do this (changing codegen to match the code comments). Or the other way around (changing code comments to match with codegen) as in D135574.

bjope abandoned this revision.May 16 2023, 7:58 AM

Adjusted code comments to match with the implementation instead (see D135574).