Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MC][X86] Disable branch align in non-text section
Summary: The instruction in non-text section can not be executed, so they will not affect performance. In addition, their encoding values are treated as data, so we should not touch them. Reviewers: MaskRay, reames, LuoYuanke, jyknight Reviewed By: MaskRay Subscribers: annita.zhang, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77971
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=ret %s | llvm-readobj -S | FileCheck %s | ||
|
||
## Check we only pad in a text section | ||
|
||
# CHECK-LABEL: Name: text | ||
# CHECK: AddressAlignment: 32 | ||
.section text, "ax" | ||
ret | ||
|
||
# CHECK-LABEL: Name: excluded | ||
# CHECK: AddressAlignment: 1 | ||
.section excluded, "e" | ||
ret | ||
|
||
# CHECK-LABEL: Name: tls | ||
# CHECK: AddressAlignment: 1 | ||
.section tls, "awT" | ||
ret |