This is an archive of the discontinued LLVM Phabricator instance.

Replace MachineRegisterInfo::isSSA() with a MachineFunctionProperty
ClosedPublic

Authored by dschuff on Mar 29 2016, 1:44 PM.

Details

Summary

Use the MachineFunctionProperty mechanism to indicate whether a MachineFunction
is in SSA form instead of a custom method on MachineRegisterInfo. NFC.

Diff Detail

Event Timeline

dschuff updated this revision to Diff 51976.Mar 29 2016, 1:44 PM
dschuff retitled this revision from to Replace MachineRegisterInfo::isSSA() with a MachineFunctionProperty.
dschuff updated this object.
dschuff added a reviewer: qcolombet.
dschuff added a subscriber: llvm-commits.

The syntax for MachineFunctionProperties is fairly verbose. I'm wondering if we want to do one or more of the following:

  1. Shorten the name of MachineFunctionProperties and/or MachineFunctionProperties::Property
  2. Rename MachineFunctionProperties::hasProperty (maybe test to match BitVector, or perhaps operator[])
  3. Rename MachineFunction::getProperties or perhaps replace it with a hasProperty or testProperty method on MachineFunction directly
  4. Make MachineFunctionProperties::Property a C-style enum rather than a scoped enum

I would say maybe 1 and 2, but I don't have a great idea for what names I'd use for 1.

qcolombet added inline comments.Apr 1 2016, 5:12 PM
include/llvm/CodeGen/MachineRegisterInfo.h
163

Can we keep the getter and setter, just update what they do?

dschuff updated this revision to Diff 52580.Apr 4 2016, 10:58 AM
dschuff edited edge metadata.

Keep MRI accessor

Put the MRI accessor back, and kept all of its uses.
(But kept the new MachineFunction::print() behavior)

include/llvm/CodeGen/MachineRegisterInfo.h
163

We can; that would obviously make this change smaller, and be easier on out-of-tree targets. Longer term if/when we get more properties we might still want to make them nicer to use. But I'm fine with keeping this accessor; the compiled code would pretty much be identical anyway.

qcolombet accepted this revision.Apr 4 2016, 11:02 AM
qcolombet edited edge metadata.
qcolombet added inline comments.
include/llvm/CodeGen/MachineRegisterInfo.h
163

Agree.

This revision is now accepted and ready to land.Apr 4 2016, 11:02 AM
This revision was automatically updated to reflect the committed changes.