This is an archive of the discontinued LLVM Phabricator instance.

MIR: Stop reinitializing target information for every use
ClosedPublic

Authored by arsenm on Mar 11 2019, 10:26 AM.

Details

Summary

Every time a physical register reference was parsed, this would
initialize a string map for every register in in target, and discard
it for the next. The same applies for the other fields initialized
from target information.

Follow along with how the function state is tracked, and add a new
tracking class for target information.

The string->register class/register bank for some reason were kept
separately, so track them in the same place.

Diff Detail

Event Timeline

arsenm created this revision.Mar 11 2019, 10:26 AM
thegameg accepted this revision.Mar 11 2019, 1:00 PM

LGTM, thanks!

lib/CodeGen/MIRParser/MIRParser.cpp
56

nit: Optional<PerTargetMIParsingState>?

This revision is now accepted and ready to land.Mar 11 2019, 1:00 PM
arsenm marked an inline comment as done.Mar 11 2019, 1:27 PM
arsenm added inline comments.
lib/CodeGen/MIRParser/MIRParser.cpp
56

I don't think Optional really applies here. It's not really optional, so much as the construction needs to be delayed until a Subtarget is eventually available.

thegameg added inline comments.Mar 11 2019, 1:42 PM
lib/CodeGen/MIRParser/MIRParser.cpp
56

Yeah, both are fine with me after all.

arsenm closed this revision.Mar 12 2019, 1:41 PM

r355970