This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Add helper function for getting EVT from LLT
ClosedPublic

Authored by arsenm on Aug 2 2021, 7:40 AM.

Details

Summary

This can only give an imperfect approximation, but is enough to avoid
crashing in places where we call into EVT functions starting from LLTs.

Diff Detail

Unit TestsFailed

Event Timeline

arsenm created this revision.Aug 2 2021, 7:40 AM
arsenm requested review of this revision.Aug 2 2021, 7:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 7:40 AM
Herald added a subscriber: wdng. · View Herald Transcript
paquette added inline comments.Aug 5 2021, 3:22 PM
llvm/lib/CodeGen/TargetLoweringBase.cpp
1753

Since this is an approximation, could this return the wrong answer?

arsenm added inline comments.Aug 5 2021, 4:02 PM
llvm/lib/CodeGen/TargetLoweringBase.cpp
1753

Depends what you mean by "wrong". Mostly this just loses FP types and pointers and returns an int type

aemerson accepted this revision.Aug 5 2021, 4:04 PM

LGTM. I was about to add the same thing.

This revision is now accepted and ready to land.Aug 5 2021, 4:04 PM

Ping. I need this for store merging. Can you commit?

Ping as well, I just wrote a combine that needs this.