mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-30 15:32:52 +01:00
7e501cf4c3
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 llvm-svn: 186280
73 lines
1.8 KiB
LLVM
73 lines
1.8 KiB
LLVM
; Ensure that the select instruction is supported and is lowered to
|
|
; some sort of branch instruction.
|
|
;
|
|
; RUN: llc < %s -march=mblaze -mattr=+mul,+fpu,+barrel | FileCheck %s
|
|
|
|
declare i32 @printf(i8*, ...)
|
|
@MSG = internal constant [13 x i8] c"Message: %d\0A\00"
|
|
|
|
@BLKS = private constant [5 x i8*]
|
|
[ i8* blockaddress(@brind, %L1),
|
|
i8* blockaddress(@brind, %L2),
|
|
i8* blockaddress(@brind, %L3),
|
|
i8* blockaddress(@brind, %L4),
|
|
i8* blockaddress(@brind, %L5) ]
|
|
|
|
define i32 @brind(i32 %a, i32 %b)
|
|
{
|
|
; CHECK-LABEL: brind:
|
|
entry:
|
|
br label %loop
|
|
|
|
loop:
|
|
%tmp.0 = phi i32 [ 0, %entry ], [ %tmp.8, %finish ]
|
|
%dst.0 = getelementptr [5 x i8*]* @BLKS, i32 0, i32 %tmp.0
|
|
%dst.1 = load i8** %dst.0
|
|
indirectbr i8* %dst.1, [ label %L1,
|
|
label %L2,
|
|
label %L3,
|
|
label %L4,
|
|
label %L5 ]
|
|
; CHECK: brad {{r[0-9]*}}
|
|
|
|
L1:
|
|
%tmp.1 = add i32 %a, %b
|
|
br label %finish
|
|
; CHECK: brid
|
|
|
|
L2:
|
|
%tmp.2 = sub i32 %a, %b
|
|
br label %finish
|
|
; CHECK: brid
|
|
|
|
L3:
|
|
%tmp.3 = mul i32 %a, %b
|
|
br label %finish
|
|
; CHECK: brid
|
|
|
|
L4:
|
|
%tmp.4 = sdiv i32 %a, %b
|
|
br label %finish
|
|
; CHECK: brid
|
|
|
|
L5:
|
|
%tmp.5 = srem i32 %a, %b
|
|
br label %finish
|
|
|
|
finish:
|
|
%tmp.6 = phi i32 [ %tmp.1, %L1 ],
|
|
[ %tmp.2, %L2 ],
|
|
[ %tmp.3, %L3 ],
|
|
[ %tmp.4, %L4 ],
|
|
[ %tmp.5, %L5 ]
|
|
|
|
call i32 (i8*,...)* @printf( i8* getelementptr([13 x i8]* @MSG,i32 0,i32 0),
|
|
i32 %tmp.6)
|
|
|
|
%tmp.7 = add i32 %tmp.0, 1
|
|
%tmp.8 = urem i32 %tmp.7, 5
|
|
|
|
br label %loop
|
|
; CHECK: brad {{r[0-9]*}}
|
|
}
|