Skip to content

Added support for apxf target feature #139534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

madhav-madhusoodanan
Copy link
Contributor

@madhav-madhusoodanan madhav-madhusoodanan commented Apr 8, 2025

Context

  1. Added the apxf target feature, which is dependent upon the LLVM features egpr, push2pop2, ppx, ndd, ccmp, nf, cf and zu.
  2. Converted dependencies of LLVMFeature from an Option to a SmallVec to support multiple dependencies.

Associated Issue

cc: @sayantn

@rustbot
Copy link
Collaborator

rustbot commented Apr 8, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 8, 2025
@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from 970fb61 to 336c5f9 Compare April 8, 2025 15:40
@madhav-madhusoodanan madhav-madhusoodanan marked this pull request as ready for review April 8, 2025 15:41
@madhav-madhusoodanan madhav-madhusoodanan marked this pull request as draft April 8, 2025 15:43
@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from 336c5f9 to 282deb3 Compare April 8, 2025 16:56
@rust-log-analyzer

This comment has been minimized.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from 282deb3 to d7bc563 Compare April 8, 2025 17:20
@rust-log-analyzer

This comment has been minimized.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from d7bc563 to b3e9d21 Compare April 8, 2025 17:38
@rust-log-analyzer

This comment has been minimized.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from b3e9d21 to c0626b5 Compare April 8, 2025 17:48
@rust-log-analyzer

This comment has been minimized.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from c0626b5 to 994c752 Compare April 8, 2025 17:59
@rust-log-analyzer

This comment has been minimized.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from 994c752 to eaf714b Compare April 8, 2025 18:29
@rust-log-analyzer

This comment has been minimized.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from eaf714b to 6c4b6dc Compare April 8, 2025 18:55
@madhav-madhusoodanan madhav-madhusoodanan marked this pull request as ready for review April 8, 2025 19:54
@madhav-madhusoodanan
Copy link
Contributor Author

I would be grateful if a perf-run could be initiated for this PR.

I think I do not have sufficient privileges for initiating it.

Copy link
Contributor

@sayantn sayantn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do run ./x check tidy before you push, it ensures that CI won't fail right away due to tidy checks

@SparrowLii
Copy link
Member

Sry I'm not familar with llvm so
r? codegen

@rustbot rustbot assigned workingjubilee and unassigned SparrowLii Apr 9, 2025
@madhav-madhusoodanan
Copy link
Contributor Author

Have updated dependencies from a SmallVec<[_, 10]> to a SmallVec<[_, 1]>.

@Kobzol
Copy link
Contributor

Kobzol commented Apr 10, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 10, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2025
…ure-addition, r=<try>

Added capability to add multiple dependencies for an LLVMFeature
@bors
Copy link
Collaborator

bors commented Apr 10, 2025

⌛ Trying commit 99b5a86 with merge e3d0b57...

@bors
Copy link
Collaborator

bors commented Apr 10, 2025

☀️ Try build successful - checks-actions
Build commit: e3d0b57 (e3d0b57c7d61bdc8834ac5fd480f14f9182751ba)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e3d0b57): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.5%, 0.9%] 2
Improvements ✅
(primary)
-0.6% [-1.2%, -0.2%] 3
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.2%] 17
All ❌✅ (primary) -0.6% [-1.2%, -0.2%] 3

Max RSS (memory usage)

Results (secondary -0.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [2.8%, 3.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.9% [-6.9%, -6.9%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 780.245s -> 779.828s (-0.05%)
Artifact size: 366.19 MiB -> 366.21 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 10, 2025
@madhav-madhusoodanan madhav-madhusoodanan changed the title Added capability to add multiple dependencies for an LLVMFeature Added support for apxf target feature Apr 21, 2025
@rust-log-analyzer

This comment has been minimized.

@sayantn
Copy link
Contributor

sayantn commented Apr 21, 2025

You also have to add apxf to tests/ui/check-cfg/target_feature.stderr

@sayantn
Copy link
Contributor

sayantn commented Apr 23, 2025

@chorman0773 should inline-asm-use-gpr32 be added here? Or are we completely going to reg_ext for gpr32?

@chorman0773
Copy link
Contributor

No, leave it off. There are enough instructions that you can't necessarily use an egpr.

@madhav-madhusoodanan madhav-madhusoodanan force-pushed the apx-target-feature-addition branch from b260411 to 9d85006 Compare April 23, 2025 07:42
@madhav-madhusoodanan
Copy link
Contributor Author

No, leave it off. There are enough instructions that you can't necessarily use an egpr.

Just to clarify, llvm_utils by default wraps the target string into an LLVMFeature, so I'm guessing we wouldn't explicitly need to add inline-asm-use-gpr32 right? (incase a developer needs to use the feature, that is)

@sayantn
Copy link
Contributor

sayantn commented Apr 23, 2025

iiuc, the reason apxf should not imply inline-asm-use-gpr32 is that the new r16-31 registers don't support evex or vex encoded instructions, only rex2 encoding. So they can't be used as regular registers. If inline-asm-use-gpr32 is enabled, llvm might assign a egpr in a reg class, which will generate invalid asm. Target features should not create unsoundess (although they have the potential to do so 😆). There are llvm constraints that we can use to allow users to use gpr32 without activating the i-a-u-g32 tag, so this is not a loss. @chorman0773 is working on a new reg class that will do exactly this, so no need for i-a-u-g32 here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants