This is an archive of the discontinued LLVM Phabricator instance.

MachineRegionInfo: fix pass initialization
ClosedPublic

Authored by thegameg on Feb 17 2017, 3:01 PM.

Details

Reviewers
MatzeB
arsenm
Summary
  • Adapt MachineBasicBlock::getName() to have the same behavior as the IR BasicBlock (Value::getName()).
  • Add it to lib/CodeGen/CodeGen.cpp::initializeCodeGen so that it is linked in the CodeGen library.
  • MachineRegionInfoPass's name conflicts with RegionInfoPass's name ("region").
  • MachineRegionInfo should depend on MachineDominatorTree, MachinePostDominatorTree and MachineDominanceFrontier instead of their respective IR versions.
  • Since there were no tests for this, add a X86 MIR test.

Diff Detail

Event Timeline

thegameg created this revision.Feb 17 2017, 3:01 PM
arsenm accepted this revision.Feb 17 2017, 3:11 PM

LGTM with name fix

lib/CodeGen/MachineRegionInfo.cpp
7

machine-region-info to better match name

126–127

Use DEBUG_TYPE

131–132

Ditto

This revision is now accepted and ready to land.Feb 17 2017, 3:11 PM
MatzeB added inline comments.Feb 17 2017, 3:19 PM
test/CodeGen/MIR/Generic/machine-region-info.ll
1–2 ↗(On Diff #88965)

I'd try to write a .mir test directly, instead of only generating it as an intermediate step.

thegameg updated this revision to Diff 88973.Feb 17 2017, 3:32 PM
  • Update pass name.
  • Directly add an X86 MIR test instead of generating it.
thegameg updated this revision to Diff 88991.Feb 17 2017, 4:41 PM
thegameg marked 3 inline comments as done.
thegameg edited the summary of this revision. (Show Details)
  • Simplify MIR test. Removing IR causes MachineBasicBlock::getName() to return "(null)".
  • Return an empty string instead of "(null)" in MachineBasicBlock::getName() (same behavior as Value::getName()).
thegameg marked an inline comment as done.Feb 17 2017, 4:41 PM
MatzeB accepted this revision.Feb 17 2017, 4:45 PM

LGTM, I will commit on your behalf.

MatzeB closed this revision.Feb 17 2017, 4:54 PM

Committed in 295518