This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Improve MachineIRBuilder construction
ClosedPublic

Authored by arsenm on Jun 8 2020, 4:52 AM.

Details

Summary

The current relationship between LegalizerHelper and MachineIRBuilder
confuses me, because the LegalizerHelper modifies the MachineIRBuilder
which it does not own. Constructing a LegalizerHelper destroys the
insert point, since the constructor calls setMF, which clears all the
fields. Try to separate these functions, so it's possible to construct
a LegalizerHelper from an existing MachineIRBuilder without losing the
insert point/debug loc.

Diff Detail