Page MenuHomePhabricator

LLVM Changes for alloc_align
ClosedPublic

Authored by erichkeane on Feb 6 2017, 11:31 AM.

Details

Summary

GCC has the alloc_align attribute, which is similar to assume_aligned, except the attribute's parameter is the index of the integer parameter that needs aligning to.

This is the required LLVM changes to make this happen.

Event Timeline

erichkeane created this revision.Feb 6 2017, 11:31 AM
mehdi_amini edited edge metadata.Feb 6 2017, 11:36 AM

There is no client of the API in LLVM? Can you link this revision to the one that is using this in Clang?

There is no client of the API in LLVM? Can you link this revision to the one that is using this in Clang?

Nevermind our messages crossed :)

Mehdi- Did you get a chance to take a look at this?

Thanks!
-Erich

myatsina added inline comments.Mar 19 2017, 2:32 AM
include/llvm/IR/IRBuilder.h
1810 ↗(On Diff #92813)

Please add function documentation here as well.

1876 ↗(On Diff #92813)

I think we should do a signed cast. If the original value is negative, then we want to preserve it and then choose "0".

erichkeane updated this revision to Diff 92708.Mar 22 2017, 2:20 PM
erichkeane marked 2 inline comments as done.

Thanks for the review! Changes made.

myatsina added inline comments.Mar 23 2017, 1:52 AM
include/llvm/IR/IRBuilder.h
1879 ↗(On Diff #92813)

Sorry, I missed this one in my previous comment.
Now, that we are creating a signed cast, the comparison should be signed as well (ICMP_SGT).
This will also affect the tests in the clang part of the review.

erichkeane updated this revision to Diff 92813.Mar 23 2017, 9:05 AM

Implement Marina's sign compare correction.

This revision is now accepted and ready to land.Mar 23 2017, 9:29 AM
This revision was automatically updated to reflect the committed changes.