This is an archive of the discontinued LLVM Phabricator instance.

Make X86CallFrameOptimization work with code generated by fast isel.
ClosedPublic

Authored by thakis on Jul 13 2016, 1:43 PM.

Details

Reviewers
hansw
mkuper
rnk
Summary

My motivation is that I want to enable fast isel for thiscall and other callee-pop calls, but that currently means codegen stops creating pushls, which means test/CodeGen/X86/win32_sret.ll starts failing (harmlesly) with the fast isel change, and updating it to have to different expectations is harder than just teaching this pass about fast isel code -- and this fixes a TODO too.

Diff Detail

Event Timeline

thakis updated this revision to Diff 63853.Jul 13 2016, 1:43 PM
thakis retitled this revision from to Make X86CallFrameOptimization work with code generated by fast isel..
thakis updated this object.
thakis added reviewers: mkuper, rnk.
thakis added a subscriber: llvm-commits.
mkuper edited edge metadata.Jul 13 2016, 2:37 PM

The change itself LGTM.

However, I don't think we should be running this pass at all with CodeGenOpt::None.
It was originally enabled only for -Os, and was later also enabled (by Hans, IIRC) for other opt level - but I think enabling it for -O0 was unintentional.

That makes sense, I was surprised the pass was running at -O0 to be honest. I'll still land this, since it fixes a TODO. Thanks for the review!

Landed in r275320.

labath added a subscriber: labath.Jul 14 2016, 6:17 AM

The optimized frames this change produces are confusing lldb's unwinder. We'll try to make it more resilient as that is a generally useful thing, but either way, I do recommend switching this off for -O0.

https://reviews.llvm.org/D22362 removes this pass from -O0 (which means this change here won't have an observable effect anymore).

mkuper accepted this revision.Jan 30 2017, 4:27 PM

This was committed, but the review was never closed. Cleaning up.

This revision is now accepted and ready to land.Jan 30 2017, 4:27 PM
mkuper closed this revision.Jan 30 2017, 4:27 PM