llvm-project/llvm/test/CodeGen
Diogo Sampaio 83cdb654e4 [AArch64][Fix] LdSt optimization generate premature stack-popping
Summary:
When moving add and sub to memory operand instructions,
aarch64-ldst-opt would prematurally pop the stack pointer,
before memory instructions that do access the stack using
indirect loads.
e.g.
```
int foo(int offset){
    int local[4] = {0};
    return local[offset];
}
```
would generate:
```
sub     sp, sp, #16            ; Push the stack
mov     x8, sp                 ; Save stack in register
stp     xzr, xzr, [sp], #16    ; Zero initialize stack, and post-increment, making it invalid
------ If an exception goes here, the stack value might be corrupted
ldr     w0, [x8, w0, sxtw #2]  ; Access correct position, but it is not guarded by SP
```

Reviewers: fhahn, foad, thegameg, eli.friedman, efriedma

Reviewed By: efriedma

Subscribers: efriedma, kristof.beyls, hiraditya, danielkiss, llvm-commits, simon_tatham

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75755
2020-03-14 02:03:10 +00:00
..
AArch64 [AArch64][Fix] LdSt optimization generate premature stack-popping 2020-03-14 02:03:10 +00:00
AMDGPU [AMDGPU] Fix endcf collapse 2020-03-13 13:50:21 -07:00
ARC
ARM [ARM] Long shift tests. NFC 2020-03-12 19:01:49 +00:00
AVR [AVR] Fix incorrect register state for LDRdPtr 2020-03-03 17:34:54 +08:00
BPF [llvm-objdump] -d: print `00000000 <foo>:` instead of `00000000 foo:` 2020-03-05 18:05:28 -08:00
Generic Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
Hexagon [Hexagon] Fix match pattern in a testcase 2020-03-09 09:09:58 -05:00
Inputs
Lanai Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
MIR Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-03-13 15:37:44 -04:00
MSP430
Mips [llvm-objdump] -d: print `00000000 <foo>:` instead of `00000000 foo:` 2020-03-05 18:05:28 -08:00
NVPTX ARM: Fixup some tests using denormal-fp-math attribute 2020-03-10 14:02:06 -04:00
PowerPC [PowerPC][AIX] Implement formal arguments passed in stack memory. 2020-03-12 11:48:00 -04:00
RISCV [llvm-objdump] -d: print `00000000 <foo>:` instead of `00000000 foo:` 2020-03-05 18:05:28 -08:00
SPARC [Sparc] Fix incorrect operand for matching CMPri pattern 2020-03-02 11:36:32 +08:00
SystemZ [SystemZ] Improve foldMemoryOperandImpl(). 2020-03-10 15:54:47 +01:00
Thumb [llvm-objdump] -d: print `00000000 <foo>:` instead of `00000000 foo:` 2020-03-05 18:05:28 -08:00
Thumb2 [ARM] Optimise ASRL/LSRL to smaller shifts using demand bits. 2020-03-13 10:09:03 +00:00
VE [VE] Target-specific bit size for sjljehprepare 2020-03-10 17:51:16 +01:00
WebAssembly [WebAssembly] Fix SIMD shift unrolling to avoid assertion failure 2020-03-12 12:20:14 -07:00
WinCFGuard
WinEH
X86 [X86] Remove isel patterns for X86VBroadcast+trunc+extload. Replace with DAG combines. 2020-03-13 18:12:16 -07:00
XCore [XCore] Add instruction pattern for bitrev 2020-02-21 09:28:49 +08:00