mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
The post-indexed instructions were missing the constraint, causing unpredictable STR instructions to be emitted. The earlyclobber constraint on the pre-indexed STR instructions is not strictly necessary, as the instruction selection for pre-indexed STR instructions goes through an additional layer of pseudo instructions which have the constraint defined, however it doesn't hurt to specify the constraint directly on the pre-indexed instructions as well, since at some point someone might create instances of them programmatically and then the constraint is definitely needed. This fixes PR20323. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213369 91177308-0d34-0410-b5e6-96231b3b80d8
14 lines
416 B
LLVM
14 lines
416 B
LLVM
; RUN: llc -mtriple=armv7-linux-gnueabihf %s -o - | FileCheck %s
|
|
|
|
; Check that we don't create an unpredictable STR instruction,
|
|
; e.g. str r0, [r0], #4
|
|
|
|
define i32* @earlyclobber-str-post(i32* %addr) nounwind {
|
|
; CHECK: earlyclobber-str-post
|
|
; CHECK-NOT: str r[[REG:[0-9]+]], [r[[REG]]], #4
|
|
%val = ptrtoint i32* %addr to i32
|
|
store i32 %val, i32* %addr
|
|
%new = getelementptr i32* %addr, i32 1
|
|
ret i32* %new
|
|
}
|