This is an archive of the discontinued LLVM Phabricator instance.

[Driver][X86] Add an alias for -mpad-max-prefix-size
AbandonedPublic

Authored by skan on Apr 8 2020, 6:58 AM.

Details

Summary

LLVM does not have an option same as GAS's -malign-branch-prefix-size. GAS' s -malign-branch-prefix-size only elminates NOPs emitted by branch align, but clang's option -mpad-max-prefix-size aslo eliminates NOPs emitted by align directive. The two options are similar but slightly different.

My point is that we can make -malign-branch-prefix-size an alias for -mpad-max-prefix-size for user convenience when they need to prefix padding branches, but I am not sure whether it's appropriate. This revison is open mainly for discussion and I will not commit it if there is any objection.

Diff Detail

Event Timeline

skan created this revision.Apr 8 2020, 6:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2020, 6:58 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Make -malign-branch-prefix-size an alias for -mpad-max-prefix-size (For GCC compatibility)

I cannot find a discussion on -mpad-max-prefix-size. Is it a planned GNU as option or GCC driver option?

skan added a comment.Apr 8 2020, 7:08 PM

Make -malign-branch-prefix-size an alias for -mpad-max-prefix-size (For GCC compatibility)

I cannot find a discussion on -mpad-max-prefix-size. Is it a planned GNU as option or GCC driver option?

-mpad-max-prefix-size has nothing to do with GCC, it exposes the -x86-pad-max-prefix-size to clang

Make -malign-branch-prefix-size an alias for -mpad-max-prefix-size (For GCC compatibility)

I cannot find a discussion on -mpad-max-prefix-size. Is it a planned GNU as option or GCC driver option?

-mpad-max-prefix-size has nothing to do with GCC, it exposes the -x86-pad-max-prefix-size to clang

Then it is incorrect to say HelpText<"Alias for -mpad-max-prefix-size">;// Alias for GCC compatibility

skan added a comment.Apr 8 2020, 8:15 PM

Make -malign-branch-prefix-size an alias for -mpad-max-prefix-size (For GCC compatibility)

I cannot find a discussion on -mpad-max-prefix-size. Is it a planned GNU as option or GCC driver option?

-mpad-max-prefix-size has nothing to do with GCC, it exposes the -x86-pad-max-prefix-size to clang

Then it is incorrect to say HelpText<"Alias for -mpad-max-prefix-size">;// Alias for GCC compatibility

Fine, we can have more discussion on this revision. D77628 really has nothing to do with GCC/GAS compatibility, could you remove the "request change"?

skan updated this revision to Diff 256250.Apr 9 2020, 4:56 AM

Rebase

skan edited the summary of this revision. (Show Details)Apr 9 2020, 5:14 AM
skan updated this revision to Diff 256268.Apr 9 2020, 6:02 AM
skan edited the summary of this revision. (Show Details)

Rebase(didn't rebase correctly last time)

skan updated this revision to Diff 256308.Apr 9 2020, 7:48 AM

Fix the tests after rebase

skan added a comment.Apr 12 2020, 10:54 PM

After careful consideration, I agree with @MaskRay ’s point of view that this alias is incorrect since they do different things. If there is no objection, I plan to abandon this revision.

skan abandoned this revision.Apr 14 2020, 3:27 AM