This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Avoid creating COPY in LegalizationArtifactCombiner
ClosedPublic

Authored by Petar.Avramovic on Aug 18 2021, 10:14 AM.

Details

Summary

When Src and Dst used in buildAnyExtOrTrunc or buildSExtOrTrunc
have the same type (creates COPY) use Src register directly or
use replaceRegOrBuildCopy instead.

Diff Detail

Event Timeline

Petar.Avramovic requested review of this revision.Aug 18 2021, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2021, 10:14 AM
aemerson added inline comments.Aug 20 2021, 2:35 PM
llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
135

should this be else if?

foad accepted this revision.Aug 23 2021, 8:44 AM

LGTM!

llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
135

I don't think it needs to be since SextSrc and TruncSrc are mutually exclusive.

This revision is now accepted and ready to land.Aug 23 2021, 8:44 AM