This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add a combine for sext_inreg(load x), c --> sextload x
ClosedPublic

Authored by aemerson on Aug 14 2020, 3:26 AM.

Details

Summary

This is restricted to single use loads, which if we fold to sextloads we can find more optimal addressing modes on AArch64.

Diff Detail

Event Timeline

aemerson created this revision.Aug 14 2020, 3:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2020, 3:26 AM
aemerson requested review of this revision.Aug 14 2020, 3:26 AM
paquette accepted this revision.Aug 14 2020, 9:20 AM

LGTM with a couple nits on comments

(I can totally imagine typing "InReg" all of the time instead of "Inreg" and getting annoyed, but that may be a personal fault.)

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
618

I don't think we need Doxygen comments here?

665

Comment is weird here?

668

I don't think we do this everywhere in the combiner. Should we be doing this everywhere? (We should probably be doing this everywhere.)

This revision is now accepted and ready to land.Aug 14 2020, 9:20 AM
arsenm added inline comments.Aug 14 2020, 9:23 AM
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
669

Should get the function from the builder

aemerson added inline comments.Aug 14 2020, 9:43 AM
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
665

Yeah this got separated from it's LOC.

668

Yep, I think so.

aemerson updated this revision to Diff 285677.Aug 14 2020, 9:50 AM
This revision was landed with ongoing or failed builds.Aug 18 2020, 10:42 AM
This revision was automatically updated to reflect the committed changes.