This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use precise CFI for pushes by default
ClosedPublic

Authored by mkuper on Nov 24 2015, 5:41 AM.

Details

Summary

As discussed on the list, this always generates precise CFI.

I'd still like to hook up the imprecise behavior to a switch, but I'm not sure exactly what kind of switch. So I'd like to leave the other option in, but temporary dead. If there's a strong objection to that, I'll pull it out completely, and re-introduce later.

Diff Detail

Repository
rL LLVM

Event Timeline

mkuper updated this revision to Diff 41032.Nov 24 2015, 5:41 AM
mkuper retitled this revision from to [X86] Use precise CFI for pushes by default.
mkuper updated this object.
mkuper added reviewers: rafael, rnk, DavidKreitzer.
mkuper added a subscriber: llvm-commits.
mkuper added inline comments.Nov 24 2015, 5:44 AM
test/CodeGen/X86/push-cfi.ll
1 ↗(On Diff #41032)

Ignore this, should not have the new prefix here.

rnk edited edge metadata.Nov 24 2015, 1:29 PM

MachO compact unwind info can't support precise unwind info, though, right? Should this depend on the target?

DavidKreitzer edited edge metadata.Nov 24 2015, 2:32 PM

Just a few minor comments, Michael. Otherwise, I think this looks good.

-Dave

include/llvm/CodeGen/MachineModuleInfo.h
170 ↗(On Diff #41032)

It might be a good idea to add the main points of our discussion to this comment:

  • that synchronous (i.e. non-precise) unwind info should be enabled under some yet-to-be-defined switch
  • that we would first need the ability to simultaneously emit a synchronous .eh_frame and precise .debug_frame under that switch
243 ↗(On Diff #41032)

This should return void, right?

test/CodeGen/X86/push-cfi.ll
12 ↗(On Diff #41032)

typo "eeither"

Thank Dave, Reid!

In D14948#296095, @rnk wrote:

MachO compact unwind info can't support precise unwind info, though, right? Should this depend on the target?

Right. but it can't support the "less precise" version either, if there is more than one call in a function. So this doesn't control the MachO behavior.

include/llvm/CodeGen/MachineModuleInfo.h
170 ↗(On Diff #41032)

Yes, right, no point in deferring right until I actually add the switch.

243 ↗(On Diff #41032)

Argh, right, thanks!

mkuper updated this revision to Diff 41245.Nov 26 2015, 5:57 AM
mkuper edited edge metadata.

Addressed Dave's comments.

rafael added inline comments.Dec 2 2015, 6:11 AM
include/llvm/CodeGen/MachineModuleInfo.h
168 ↗(On Diff #41245)

Don't repeat name in comment.

249 ↗(On Diff #41245)

Nothing calls this, so it is dead code.

Do you have a followup patch that uses it?

mkuper added a comment.Dec 2 2015, 6:21 AM

Thanks, Rafael.

include/llvm/CodeGen/MachineModuleInfo.h
168 ↗(On Diff #41245)

Following style of surrounding code...

249 ↗(On Diff #41245)

Not yet, although one is eventually planned, per the comment in line 176.
As I wrote in the summary, I can pull out the dead code (and replace it with TODOs), if there's an objection to keeping it in the meanwhile.

mkuper updated this revision to Diff 41723.Dec 3 2015, 1:34 AM

Replaced dead code with TODOs to bring it back.

rafael accepted this revision.Dec 3 2015, 5:16 AM
rafael edited edge metadata.

LGTM

thanks

This revision is now accepted and ready to land.Dec 3 2015, 5:16 AM
This revision was automatically updated to reflect the committed changes.