mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix PR 17372: Emitting PLD for stack address for ARM Thumb2
t2PLDi12, t2PLDi8, t2PLDs was omitted in Thumb2InstrInfo. This patch fixes it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191441 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
daf6b948b9
commit
82f36241c2
@ -334,6 +334,7 @@ negativeOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRi12: return ARM::t2STRi8;
|
||||
case ARM::t2STRBi12: return ARM::t2STRBi8;
|
||||
case ARM::t2STRHi12: return ARM::t2STRHi8;
|
||||
case ARM::t2PLDi12: return ARM::t2PLDi8;
|
||||
|
||||
case ARM::t2LDRi8:
|
||||
case ARM::t2LDRHi8:
|
||||
@ -343,6 +344,7 @@ negativeOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRi8:
|
||||
case ARM::t2STRBi8:
|
||||
case ARM::t2STRHi8:
|
||||
case ARM::t2PLDi8:
|
||||
return opcode;
|
||||
|
||||
default:
|
||||
@ -364,6 +366,7 @@ positiveOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRi8: return ARM::t2STRi12;
|
||||
case ARM::t2STRBi8: return ARM::t2STRBi12;
|
||||
case ARM::t2STRHi8: return ARM::t2STRHi12;
|
||||
case ARM::t2PLDi8: return ARM::t2PLDi12;
|
||||
|
||||
case ARM::t2LDRi12:
|
||||
case ARM::t2LDRHi12:
|
||||
@ -373,6 +376,7 @@ positiveOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRi12:
|
||||
case ARM::t2STRBi12:
|
||||
case ARM::t2STRHi12:
|
||||
case ARM::t2PLDi12:
|
||||
return opcode;
|
||||
|
||||
default:
|
||||
@ -394,6 +398,7 @@ immediateOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRs: return ARM::t2STRi12;
|
||||
case ARM::t2STRBs: return ARM::t2STRBi12;
|
||||
case ARM::t2STRHs: return ARM::t2STRHi12;
|
||||
case ARM::t2PLDs: return ARM::t2PLDi12;
|
||||
|
||||
case ARM::t2LDRi12:
|
||||
case ARM::t2LDRHi12:
|
||||
@ -403,6 +408,7 @@ immediateOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRi12:
|
||||
case ARM::t2STRBi12:
|
||||
case ARM::t2STRHi12:
|
||||
case ARM::t2PLDi12:
|
||||
case ARM::t2LDRi8:
|
||||
case ARM::t2LDRHi8:
|
||||
case ARM::t2LDRBi8:
|
||||
@ -411,6 +417,7 @@ immediateOffsetOpcode(unsigned opcode)
|
||||
case ARM::t2STRi8:
|
||||
case ARM::t2STRBi8:
|
||||
case ARM::t2STRHi8:
|
||||
case ARM::t2PLDi8:
|
||||
return opcode;
|
||||
|
||||
default:
|
||||
|
22
test/CodeGen/ARM/prefetch-thumb.ll
Normal file
22
test/CodeGen/ARM/prefetch-thumb.ll
Normal file
@ -0,0 +1,22 @@
|
||||
; RUN: llc < %s -march=thumb -mattr=+v7 | FileCheck %s -check-prefix=THUMB2
|
||||
; TODO: This test case will be merged back into prefetch.ll when ARM mode issue is solved.
|
||||
|
||||
declare void @llvm.prefetch(i8*, i32, i32, i32) nounwind
|
||||
|
||||
define void @t6() {
|
||||
entry:
|
||||
;ARM: t6:
|
||||
;ARM: pld [sp]
|
||||
;ARM: pld [sp, #50]
|
||||
|
||||
;THUMB2: t6:
|
||||
;THUMB2: pld [sp]
|
||||
;THUMB2: pld [sp, #50]
|
||||
|
||||
%red = alloca [100 x i8], align 1
|
||||
%0 = getelementptr inbounds [100 x i8]* %red, i32 0, i32 0
|
||||
%1 = getelementptr inbounds [100 x i8]* %red, i32 0, i32 50
|
||||
call void @llvm.prefetch(i8* %0, i32 0, i32 3, i32 1)
|
||||
call void @llvm.prefetch(i8* %1, i32 0, i32 3, i32 1)
|
||||
ret void
|
||||
}
|
Loading…
Reference in New Issue
Block a user