Page MenuHomePhabricator

[ARM GlobalISel] Make arm_i32imm an IntImmLeaf
ClosedPublic

Authored by rovka on Feb 11 2019, 2:58 AM.

Details

Summary

r353501 made it possible to check for the useMovt subtarget
feature without accessing the MachineFunction. Therefore, we
can rewrite the arm_i32imm definition as an IntImmLeaf instead
of a PatLeaf to reduce some of the boilerplate.

Note however that there is currently no support for a GlobalISel-specific
ImmediateCode field, so we must use the same custom code for both
GlobalISel and DAGISel. This gets rid of some duplication in the TableGen
definition, but it forces us to keep both a pointer and a reference to the
subtarget in the ARMInstructionSelector.

That is pretty ugly but it might be a reasonable trade-off, since the TableGen
descriptions should outlive the code in the selector (or in the worst case we
can update to use just the reference when we get rid of DAGISel).

Diff Detail

Repository
rL LLVM

Event Timeline

rovka created this revision.Feb 11 2019, 2:58 AM
rovka edited reviewers, added: eli.friedman; removed: eliben.Feb 11 2019, 2:59 AM
efriedma accepted this revision.Feb 27 2019, 4:45 PM
efriedma added a subscriber: efriedma.

LGTM

This revision is now accepted and ready to land.Feb 27 2019, 4:45 PM
This revision was automatically updated to reflect the committed changes.