This is an archive of the discontinued LLVM Phabricator instance.

[InlineFunction] Only update noalias scopes once for an instruction.
ClosedPublic

Authored by jeroen.dobbelaere on Feb 2 2021, 3:58 AM.

Details

Summary

Inlining sometimes maps different instructions to be inlined onto the same instruction.

We must ensure to only remap the noalias scopes once. Otherwise the scope might disappear (at best).
This patch ensures that we only replace scopes for which the mapping is known.

This approach is preferred over tracking which instructions we already handled in a SmallPtrSet,
as that one will need more memory.

Diff Detail

Event Timeline

jeroen.dobbelaere requested review of this revision.Feb 2 2021, 3:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2021, 3:58 AM

At https://llvm-compile-time-tracker.com/index.php?config=O3&stat=instructions&branch=dobbelaj-snps/perf/InlineFunction_same_inst_20210202_01 there is a comparison of two possible approaches.
But I do not have the impression that it makes a big difference for these testcases.

nikic accepted this revision.Feb 2 2021, 8:52 AM

LGTM

This revision is now accepted and ready to land.Feb 2 2021, 8:52 AM