-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[DAGCombiner] Fix check for extending loads #112182
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
Merged
LewisCrawford
merged 1 commit into
llvm:main
from
LewisCrawford:dagcombiner_extty_check
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
35 changes: 35 additions & 0 deletions
35
llvm/test/CodeGen/AArch64/aarch64-scalarize-vec-load-ext.ll
This file contains hidden or 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,35 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s | ||
|
|
||
| ; FIXME: Currently, we avoid narrowing this v4i32 load, in the | ||
| ; hopes of being able to fold the shift, despite it requiring stack | ||
| ; storage + loads. Ideally, we should narrow here and load the i32 | ||
| ; directly from the variable offset e.g: | ||
| ; | ||
| ; add x8, x0, x1, lsl #4 | ||
| ; and x9, x2, #0x3 | ||
| ; ldr w0, [x8, x9, lsl #2] | ||
| ; | ||
| ; The AArch64TargetLowering::shouldReduceLoadWidth heuristic should | ||
| ; probably be updated to choose load-narrowing instead of folding the | ||
| ; lsl in larger vector cases. | ||
| ; | ||
| define i32 @narrow_load_v4_i32_single_ele_variable_idx(ptr %ptr, i64 %off, i32 %ele) { | ||
| ; CHECK-LABEL: narrow_load_v4_i32_single_ele_variable_idx: | ||
| ; CHECK: // %bb.0: // %entry | ||
| ; CHECK-NEXT: sub sp, sp, #16 | ||
| ; CHECK-NEXT: .cfi_def_cfa_offset 16 | ||
| ; CHECK-NEXT: ldr q0, [x0, x1, lsl #4] | ||
| ; CHECK-NEXT: mov x8, sp | ||
| ; CHECK-NEXT: // kill: def $w2 killed $w2 def $x2 | ||
| ; CHECK-NEXT: bfi x8, x2, #2, #2 | ||
| ; CHECK-NEXT: str q0, [sp] | ||
| ; CHECK-NEXT: ldr w0, [x8] | ||
| ; CHECK-NEXT: add sp, sp, #16 | ||
| ; CHECK-NEXT: ret | ||
| entry: | ||
| %idx = getelementptr inbounds <4 x i32>, ptr %ptr, i64 %off | ||
| %x = load <4 x i32>, ptr %idx, align 8 | ||
| %res = extractelement <4 x i32> %x, i32 %ele | ||
| ret i32 %res | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you merge this test with whatever test was added in the original combine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And bonus points for using update_llc_test_checks.