-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AArch64] Optimize the offset of memory access #71917
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
Comments
@llvm/issue-subscribers-backend-aarch64 Author: Allen (vfdff)
* test: https://gcc.godbolt.org/z/nhYcWq1WE
```
int testOffset(char a[]) {
return a[0xfde78];
}
```
* gcc:
```
testOffset(char*):
add x0, x0, 1036288
ldrb w0, [x0, 3704]
ret
```
* llvm:
```
testOffset(char*): // @testOffset(char*)
mov w8, #56952 // =0xde78
movk w8, #15, lsl #16
ldrb w0, [x0, x8]
ret
```
|
|
vfdff
added a commit
to vfdff/llvm-project
that referenced
this issue
Dec 5, 2023
A case for this transformation, https://gcc.godbolt.org/z/nhYcWq1WE ``` Fold mov w8, llvm#56952 movk w8, llvm#15, lsl llvm#16 ldrb w0, [x0, x8] into add x0, x0, 1036288 ldrb w0, [x0, 3704] ``` Only support single use base, multi-use scenes are supported by PR74046. Fix llvm#71917 TODO: support the multiple-uses with reuseing common base offset. https://gcc.godbolt.org/z/Mr7srTjnz
Reverted and reported issues #76202 |
vfdff
added a commit
to vfdff/llvm-project
that referenced
this issue
Jan 30, 2024
A case for this transformation, https://gcc.godbolt.org/z/nhYcWq1WE Fold mov w8, llvm#56952 movk w8, llvm#15, lsl llvm#16 ldrb w0, [x0, x8] into add x0, x0, 1036288 ldrb w0, [x0, 3704] Only LDRBBroX is supported for the first time. Fix llvm#71917
qihangkong
pushed a commit
to rvgpu/llvm
that referenced
this issue
Apr 18, 2024
qihangkong
pushed a commit
to rvgpu/rvgpu-llvm
that referenced
this issue
Apr 23, 2024
A case for this transformation, https://gcc.godbolt.org/z/nhYcWq1WE Fold mov w8, #56952 movk w8, #15, lsl #16 ldrb w0, [x0, x8] into add x0, x0, 1036288 ldrb w0, [x0, 3704] Only LDRBBroX is supported for the first time. Fix llvm/llvm-project#71917
vfdff
added a commit
to vfdff/llvm-project
that referenced
this issue
Aug 8, 2024
A case for this transformation, https://gcc.godbolt.org/z/nhYcWq1WE Fold mov w8, llvm#56952 movk w8, llvm#15, lsl llvm#16 ldrb w0, [x0, x8] into add x0, x0, 1036288 ldrb w0, [x0, 3704] Only LDRBBroX is supported for the first time. Fix llvm#71917 Note: This PR is try relanding the commit 32878c2 with fix crash for PR79756 this crash is exposes when there is MOVKWi instruction in the head of a block, but without MOVZWi
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
base addressing
produces more efficient instructions than llvm usingindex addressing
.The text was updated successfully, but these errors were encountered: