This is an archive of the discontinued LLVM Phabricator instance.

[PATCH 1/2] Add a "probe-stack" attribute (revised)
ClosedPublic

Authored by pcwalton on Jun 19 2017, 11:20 PM.

Details

Summary

I've fixed up https://reviews.llvm.org/D9653. Please let me know if you have any further suggestions. Thanks!

Diff Detail

Repository
rL LLVM

Event Timeline

pcwalton created this revision.Jun 19 2017, 11:20 PM
fhahn added a subscriber: fhahn.Jun 19 2017, 11:54 PM

It looks like you inadvertently included an entire copy of D34387 here.

That's not really my area of expertise, so I only left a few general comments. It seems like you stripped a few trailing whitespaces adding a little bit of noise to the diff. Also, diffs uploaded to Phabricator should contain as much context as possible, to make it easier to see the surrounding code (http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface), e.g. using git show HEAD -U999999 > mypatch.patch and llvm-commits should be added as subscriber when creating a review, so the full history of the review gets mirrored on the mailing list.

I think you should also include a test for your change. You could probably extend test/CodeGen/X86/stack-probe-size.ll, by adding an additional RUN line with a triple where stack probes aren't generated at the moment and add probe-stack attributes to some functions.

lib/Target/X86/X86FrameLowering.cpp
71 ↗(On Diff #103158)

unrelated whitespace change?

657 ↗(On Diff #103158)

unrelated whitespace change?

801 ↗(On Diff #103158)

Could this be a const std::string? Actually I think you could also keep the type const char * and use MF.getFunction()->getFnAttribute("probe-stack").getValueAsString().data() in line 803, as you are not using any functions from std::string

838 ↗(On Diff #103158)

Why aren't you using Is64Bit here? I think you should use the same check as in line 804.

majnemer edited edge metadata.Jun 20 2017, 9:05 AM

Please include more context in this diff.

pcwalton added inline comments.Jun 20 2017, 10:09 AM
lib/Target/X86/X86FrameLowering.cpp
801 ↗(On Diff #103158)

I did this because StringRef warns that the contents don't have to be null terminated. Is there a guarantee of null termination in this specific instance?

pcwalton updated this revision to Diff 103233.Jun 20 2017, 10:17 AM

Split this out correctly, added more context, and added the missing test.

majnemer added inline comments.Jun 20 2017, 11:14 AM
docs/LangRef.rst
1478–1480 ↗(On Diff #103233)

What if both have a probe-stack attribute but they disagree? Should we disallow inlining? Should we ignore the callee attribute?

pcwalton updated this revision to Diff 103299.Jun 20 2017, 5:09 PM

Addressed comments.

This revision is now accepted and ready to land.Jun 20 2017, 5:21 PM
tamird added a subscriber: tamird.Jun 20 2017, 7:47 PM
emaste added a subscriber: emaste.Jun 21 2017, 5:52 AM
fhahn added a comment.Jun 21 2017, 7:26 AM

@pcwalton I assume you do not have commit access? In that case somebody else has to commit the change on your behalf and it would be good to let people know.

This revision was automatically updated to reflect the committed changes.