mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-05 19:38:13 +00:00

Summary: A lot of the pseudo instructions are required because LLVM assumes that all integers of the same size as the pointer size are legal. This means that it will not currently expand 16-bit instructions to their 8-bit variants because it thinks 16-bit types are legal for the operations. This also adds all of the CodeGen tests that required the pass to run. Reviewers: arsenm, kparzysz Subscribers: wdng, mgorny, modocache, llvm-commits Differential Revision: https://reviews.llvm.org/D26577 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287162 91177308-0d34-0410-b5e6-96231b3b80d8
21 lines
590 B
LLVM
21 lines
590 B
LLVM
; RUN: llc -mattr=sram,eijmpcall < %s -march=avr | FileCheck %s
|
|
|
|
@brind.k = private unnamed_addr constant [2 x i8*] [i8* blockaddress(@brind, %return), i8* blockaddress(@brind, %b)], align 1
|
|
|
|
define i8 @brind(i8 %p) {
|
|
; CHECK-LABEL: brind:
|
|
; CHECK: ld r30
|
|
; CHECK: ldd r31
|
|
; CHECK: ijmp
|
|
entry:
|
|
%idxprom = sext i8 %p to i16
|
|
%arrayidx = getelementptr inbounds [2 x i8*], [2 x i8*]* @brind.k, i16 0, i16 %idxprom
|
|
%s = load i8*, i8** %arrayidx
|
|
indirectbr i8* %s, [label %return, label %b]
|
|
b:
|
|
br label %return
|
|
return:
|
|
%retval.0 = phi i8 [ 4, %b ], [ 2, %entry ]
|
|
ret i8 %retval.0
|
|
}
|