This is an archive of the discontinued LLVM Phabricator instance.

OpaquePtr: Require byval on x86_intrcc parameter 0
ClosedPublic

Authored by arsenm on Nov 19 2020, 7:59 PM.

Details

Summary

Currently the backend special cases x86_intrcc and treats the first
parameter as byval. Make the IR require byval for this parameter to
remove this special case, and avoid the dependence on the pointee
element type.

Fixes bug 46672.

I'm not sure the IR is enforcing all the calling convention
constraints. clang seems to ignore the attribute for empty parameter
lists, but the IR tolerates it.

Diff Detail

Event Timeline

arsenm created this revision.Nov 19 2020, 7:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2020, 7:59 PM
arsenm requested review of this revision.Nov 19 2020, 7:59 PM
craig.topper added inline comments.Nov 20 2020, 12:15 AM
llvm/test/Bitcode/compatibility-6.0.ll
439

Why do we need to change arguments here? Isn't no arguments allowed?

441

What's this extra parenthese for?

arsenm added inline comments.Nov 20 2020, 6:23 AM
llvm/test/Bitcode/compatibility-6.0.ll
439

It is allowed, although I'm not sure if it should be. Clang just ignores the attribute on functions with no arguments

441

To surprise us that this actually parses

arsenm updated this revision to Diff 308354.Nov 30 2020, 6:25 AM

Fix bitcode upgrade after rebase

rnk accepted this revision.Nov 30 2020, 1:20 PM

lgtm

Thanks for removing that special case.

This revision is now accepted and ready to land.Nov 30 2020, 1:20 PM

(generally I'd suggest splitting the clangc and llvm patches if at all possible - in this case I'm guessing the clang patch could go first (adding the attribute which would be redundant/unused initially), then the LLVM one?)