[all-commits] [llvm/llvm-project] d337c1: [AArch64] Use SUBXrx64 for dynamic stack to refer ...
chenglin.bi via All-commits
all-commits at lists.llvm.org
Tue Jul 19 20:46:25 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d337c1f2565a748bcf3f162d0754a362b2c597a4
https://github.com/llvm/llvm-project/commit/d337c1f2565a748bcf3f162d0754a362b2c597a4
Author: chenglin.bi <chenglin.bi at linaro.org>
Date: 2022-07-20 (Wed, 20 Jul 2022)
Changed paths:
M llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
M llvm/lib/Target/AArch64/AArch64InstrFormats.td
M llvm/lib/Target/AArch64/AArch64InstrInfo.td
M llvm/test/CodeGen/AArch64/win-alloca.ll
M llvm/test/CodeGen/AArch64/win64_vararg.ll
Log Message:
-----------
[AArch64] Use SUBXrx64 for dynamic stack to refer to sp
When we lower dynamic stack, we need to substract pattern `x15 << 4` from sp.
Subtract instruction with arith shifted register(SUBXrs) can't refer to sp. So for now we need two extra mov like:
```
mov x0, sp
sub x0, x0, x15, lsl #4
mov sp, x0
```
If we want to refer to sp in subtract instruction like this:
```
sub sp, sp, x15, lsl #4
```
We must use arith extended register version(SUBXrx).
So in this patch when we find sub have sp operand on src0, try to select to SubXrx64.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D129932
More information about the All-commits
mailing list