diff options
| author | Dylan McKay <me@dylanmckay.io> | 2019-06-01 12:38:56 +0000 |
|---|---|---|
| committer | Dylan McKay <me@dylanmckay.io> | 2019-06-01 12:38:56 +0000 |
| commit | 45eb4c7e55341c0b83a21dedecc092e273795eda (patch) | |
| tree | b6e59c937d1726830092715a268f93b2783581f6 /llvm/test/CodeGen | |
| parent | e6d1a80370f2e465c5aa61f6ba5f16de513aa393 (diff) | |
| download | bcm5719-llvm-45eb4c7e55341c0b83a21dedecc092e273795eda.tar.gz bcm5719-llvm-45eb4c7e55341c0b83a21dedecc092e273795eda.zip | |
[AVR] Disable register coalescing to the PTRDISPREGS class
If we would allow register coalescing on PTRDISPREGS class then register
allocator can lock Z register to some virtual register. Larger instructions
requiring a memory acces then fail during the register allocation phase since
there is no available register to hold a pointer if Y register was already
taken for a stack frame. This patch prevents it by keeping Z register
spillable. It does it by not allowing coalescer to lock it.
Original discussion on https://github.com/avr-rust/rust/issues/128.
llvm-svn: 362298
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AVR/PR37143.ll | 6 | ||||
| -rw-r--r-- | llvm/test/CodeGen/AVR/store.ll | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/AVR/PR37143.ll b/llvm/test/CodeGen/AVR/PR37143.ll index db157edc22f..72f4a2fd372 100644 --- a/llvm/test/CodeGen/AVR/PR37143.ll +++ b/llvm/test/CodeGen/AVR/PR37143.ll @@ -1,9 +1,9 @@ ; RUN: llc -mattr=avr6,sram < %s -march=avr | FileCheck %s -; CHECK: ld {{r[0-9]+}}, [[PTR:[YZ]]] +; CHECK: ld {{r[0-9]+}}, [[PTR:[XYZ]]] ; CHECK: ldd {{r[0-9]+}}, [[PTR]]+1 -; CHECK: st [[PTR]], {{r[0-9]+}} -; CHECK: std [[PTR]]+1, {{r[0-9]+}} +; CHECK: st [[PTR2:[XYZ]]], {{r[0-9]+}} +; CHECK: std [[PTR2]]+1, {{r[0-9]+}} define void @load_store_16(i16* nocapture %ptr) local_unnamed_addr #1 { entry: %0 = load i16, i16* %ptr, align 2 diff --git a/llvm/test/CodeGen/AVR/store.ll b/llvm/test/CodeGen/AVR/store.ll index bad3f61a013..81bad775387 100644 --- a/llvm/test/CodeGen/AVR/store.ll +++ b/llvm/test/CodeGen/AVR/store.ll @@ -45,9 +45,9 @@ define void @store16disp(i16* %x, i16 %y) { define void @store16nodisp(i16* %x, i16 %y) { ; CHECK-LABEL: store16nodisp: +; CHECK: subi r24, 192 +; CHECK: sbci r25, 255 ; CHECK: movw r30, r24 -; CHECK: subi r30, 192 -; CHECK: sbci r31, 255 ; CHECK: st {{[YZ]}}, r22 ; CHECK: std {{[YZ]}}+1, r23 %arrayidx = getelementptr inbounds i16, i16* %x, i16 32 |

