This is an archive of the discontinued LLVM Phabricator instance.

[LoopIdiom] Preserve alias information for memset_pattern
ClosedPublic

Authored by wsmoses on Jun 14 2023, 9:25 AM.

Details

Summary

TBAA/NoAlias/AliasScope and other information is currently preserved
when upgrading to a memcpy/memset. However, this is missing when upgrading to
the macOS memset_pattern function. This adds the same alias information preservation
to memset_pattern

Diff Detail

Event Timeline

wsmoses created this revision.Jun 14 2023, 9:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 9:25 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
wsmoses requested review of this revision.Jun 14 2023, 9:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 9:25 AM
efriedma added inline comments.Jun 14 2023, 10:33 AM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1100

Please refactor so this code isn't repeated.

wsmoses updated this revision to Diff 531434.Jun 14 2023, 11:12 AM

Reduce redundant code

efriedma added inline comments.Jun 14 2023, 11:46 AM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1091
if (!SplatValue && !isLibFuncEmittable(M, TLI, LibFunc_memset_pattern16))
  return Changed;
wsmoses updated this revision to Diff 531464.Jun 14 2023, 12:42 PM

Address comments

efriedma accepted this revision.Jun 14 2023, 12:47 PM

LGTM

llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
1082

Whitespace

This revision is now accepted and ready to land.Jun 14 2023, 12:47 PM
This revision was landed with ongoing or failed builds.Jun 14 2023, 1:15 PM
This revision was automatically updated to reflect the committed changes.