This is an archive of the discontinued LLVM Phabricator instance.

[IR] Allow absence for Min module flags and make AArch64 BTI/PAC-RET flags backward compatible
ClosedPublic

Authored by MaskRay on Jul 15 2022, 4:55 PM.

Details

Summary

D123493 introduced llvm::Module::Min to encode module flags metadata for AArch64
BTI/PAC-RET. llvm::Module::Min does not take effect when the flag is absent in
one module. This behavior is misleading and does not address backward
compatibility problems (when a bitcode with "branch-target-enforcement"==1 and
another without the flag are merged, the merge result is 1 instead of 0).

To address the problems, require Min flags to be non-negative and treat absence
as having a value of zero. For an old bitcode without
"branch-target-enforcement"/"sign-return-address", its value is as if 0.

Diff Detail

Event Timeline

MaskRay created this revision.Jul 15 2022, 4:55 PM
MaskRay requested review of this revision.Jul 15 2022, 4:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2022, 4:55 PM
danielkiss accepted this revision.Jul 18 2022, 1:24 AM

Thanks, LGTM.

This revision is now accepted and ready to land.Jul 18 2022, 1:24 AM
MaskRay updated this revision to Diff 445540.Jul 18 2022, 9:29 AM
MaskRay edited the summary of this revision. (Show Details)

Update LangRef.rst
Add comment

This revision was landed with ongoing or failed builds.Jul 18 2022, 9:35 AM
This revision was automatically updated to reflect the committed changes.