This is an archive of the discontinued LLVM Phabricator instance.

[X86FixupBWInsts] More presise register liveness if no <imp-use> on MOVs.
ClosedPublic

Authored by a.elovikov on Sep 7 2017, 4:07 AM.

Details

Summary

Subregister liveness tracking is not implemented for X86 backend, so
sometimes the whole super register is said to be live, when only a
subregister is really live. That might happen if the def and the use
are located in different MBBs, see added fixup-bw-isnt.mir test.

However, using knowledge of the specific instructions handled by the
bw-fixup-pass we can get more precise liveness information which this
change does.

Diff Detail

Repository
rL LLVM

Event Timeline

a.elovikov created this revision.Sep 7 2017, 4:07 AM
craig.topper added inline comments.Sep 13 2017, 8:33 PM
llvm/lib/Target/X86/X86FixupBWInsts.cpp
220 ↗(On Diff #114148)

I don't think the isDef and isUse check is necessary. An operand is either a use or a def. There's no third state.

craig.topper added inline comments.Sep 13 2017, 9:46 PM
llvm/lib/Target/X86/X86FixupBWInsts.cpp
169 ↗(On Diff #114148)

Not directly related to this patch, but is this TODO still accurate? When it was written this algorithm was completely different. Right now we're using the live regs after the instruction we're considering so we shouldn't be seeing live regs from the address calc right?

  • Address review comments.
a.elovikov marked 2 inline comments as done.Sep 14 2017, 1:01 AM
This revision is now accepted and ready to land.Sep 14 2017, 2:42 PM
This revision was automatically updated to reflect the committed changes.