diff options
author | David Spickett <david.spickett@linaro.org> | 2024-01-23 08:45:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 08:45:47 +0000 |
commit | f20556678c70f89f96ed01b2c6092c5f7d6efedd (patch) | |
tree | 39df855155d88cbc6fd1a86c7cfc02727a38b43d /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | |
parent | 134fcc62786d31ab73439201dce2d73808d1785a (diff) | |
download | llvm-f20556678c70f89f96ed01b2c6092c5f7d6efedd.zip llvm-f20556678c70f89f96ed01b2c6092c5f7d6efedd.tar.gz llvm-f20556678c70f89f96ed01b2c6092c5f7d6efedd.tar.bz2 |
Reland "[llvm][AArch64] Copy all operands when expanding BLR_BTI bundle (#78267)" (#78719)
This reverts commit 955417ade2648c2b1a4e5f0be697f61570590a88.
The problem with the previous version was that the bundle instruction
had arguments like "target arg1 arg2". When it's expanded we produced a
BL or BLR which can only accept one argument, the target of the branch.
Now I realise why expandCALL_RVMARKER has to copy them in mutiple steps.
The operands for the called function need to be changed to implicit
arguments of the branch instruction.
* Copy the branch target.
* Copy all register operands, marking them as implicit.
* Copy any other operands without modifying them.
Prior to any attempt to fix #77915:
BL @_setjmp, csr_aarch64_aapcs, implicit-def $lr, implicit $sp,
implicit-def dead $lr, implicit $sp, implicit-def $sp
Which is dropping the use of the arguments for the called function.
My first fix attempt produced:
BL @_setjmp, $x0, $w1, <regmask $fp ...>, implicit-def $lr, implicit
$sp, implicit-def dead $lr, implicit $sp, implicit-def $sp
It copied the arguments but as explicit arguments to the BL which only
expects 1, failing verification.
With this new change we produce:
BL @_setjmp, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit
$x0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp
Note specifically the added "implicit $x0, implicit $w1". So BL only has
1 explicit argument, but the arguments to the function are still used.
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
0 files changed, 0 insertions, 0 deletions