mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-27 13:30:05 +00:00
8b2b8a1835
This update was done with the following bash script: find test/CodeGen -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc.*debug" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC: *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP done sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186280 91177308-0d34-0410-b5e6-96231b3b80d8
68 lines
1.5 KiB
LLVM
68 lines
1.5 KiB
LLVM
; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic -mcpu=cortex-a8 -asm-verbose=false | FileCheck %s
|
|
|
|
declare void @bar(i32)
|
|
declare void @car(i32)
|
|
declare void @dar(i32)
|
|
declare void @ear(i32)
|
|
declare void @far(i32)
|
|
declare i1 @qux()
|
|
|
|
@GHJK = global i32 0
|
|
|
|
declare i8* @choose(i8*, i8*)
|
|
|
|
; BranchFolding should tail-duplicate the indirect jump to avoid
|
|
; redundant branching.
|
|
|
|
; CHECK-LABEL: tail_duplicate_me:
|
|
; CHECK: qux
|
|
; CHECK: movw r{{[0-9]+}}, :lower16:_GHJK
|
|
; CHECK: movt r{{[0-9]+}}, :upper16:_GHJK
|
|
; CHECK: str r
|
|
; CHECK-NEXT: bx r
|
|
; CHECK: qux
|
|
; CHECK: movw r{{[0-9]+}}, :lower16:_GHJK
|
|
; CHECK: movt r{{[0-9]+}}, :upper16:_GHJK
|
|
; CHECK: str r
|
|
; CHECK-NEXT: bx r
|
|
; CHECK: movw r{{[0-9]+}}, :lower16:_GHJK
|
|
; CHECK: movt r{{[0-9]+}}, :upper16:_GHJK
|
|
; CHECK: str r
|
|
; CHECK-NEXT: bx r
|
|
|
|
define void @tail_duplicate_me() nounwind {
|
|
entry:
|
|
%a = call i1 @qux()
|
|
%c = call i8* @choose(i8* blockaddress(@tail_duplicate_me, %return),
|
|
i8* blockaddress(@tail_duplicate_me, %altret))
|
|
br i1 %a, label %A, label %next
|
|
next:
|
|
%b = call i1 @qux()
|
|
br i1 %b, label %B, label %C
|
|
|
|
A:
|
|
call void @bar(i32 0)
|
|
store i32 0, i32* @GHJK
|
|
br label %M
|
|
|
|
B:
|
|
call void @car(i32 1)
|
|
store i32 0, i32* @GHJK
|
|
br label %M
|
|
|
|
C:
|
|
call void @dar(i32 2)
|
|
store i32 0, i32* @GHJK
|
|
br label %M
|
|
|
|
M:
|
|
indirectbr i8* %c, [label %return, label %altret]
|
|
|
|
return:
|
|
call void @ear(i32 1000)
|
|
ret void
|
|
altret:
|
|
call void @far(i32 1001)
|
|
ret void
|
|
}
|