llvm.org GIT mirror llvm / 28beeea
Convert tests using "| wc -l | grep ..." to use the count script. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41097 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
228 changed file(s) with 467 addition(s) and 467 deletion(s). Raw diff Collapse all Expand all
0 ; Check to make sure that Value Numbering doesn't merge casts of different
11 ; flavors.
22 ; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse | llvm-dis | \
3 ; RUN: grep {\[sz\]ext} | wc -l | grep 2
3 ; RUN: grep {\[sz\]ext} | count 2
44
55 declare void %external(int)
66
0 ; For PR1093: This test checks that llvm-upgrade correctly translates
11 ; the llvm.va_* intrinsics to their cannonical argument form (i8*).
22 ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | \
3 ; RUN: grep { bitcast} | wc -l | grep 5
3 ; RUN: grep { bitcast} | count 5
44
55 %str = internal constant [7 x ubyte] c"%d %d\0A\00" ; <[7 x ubyte]*> [#uses=1]
66
0 ; PR1137
11 ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
2 ; RUN: llvm-upgrade < %s | grep {tmp = alloca} | wc -l | grep 1
2 ; RUN: llvm-upgrade < %s | grep {tmp = alloca} | count 1
33 ;
44 target datalayout = "e-p:32:32"
55 target endian = little
0 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
1 // RUN: grep xglobWeak | grep linkonce | wc -l | grep 1
1 // RUN: grep xglobWeak | grep linkonce | count 1
22 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
3 // RUN: grep xextWeak | grep linkonce | wc -l | grep 1
3 // RUN: grep xextWeak | grep linkonce | count 1
44 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
5 // RUN: grep xWeaknoinline | grep weak | wc -l | grep 1
5 // RUN: grep xWeaknoinline | grep weak | count 1
66 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
7 // RUN: grep xWeakextnoinline | grep weak | wc -l | grep 1
7 // RUN: grep xWeakextnoinline | grep weak | count 1
88 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
9 // RUN: grep xglobnoWeak | grep linkonce | wc -l | grep 1
9 // RUN: grep xglobnoWeak | grep linkonce | count 1
1010 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
11 // RUN: grep xstatnoWeak | grep internal | wc -l | grep 1
11 // RUN: grep xstatnoWeak | grep internal | count 1
1212 // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | \
13 // RUN: grep xextnoWeak | grep linkonce | wc -l | grep 1
13 // RUN: grep xextnoWeak | grep linkonce | count 1
1414 inline int xglobWeak(int) __attribute__((weak));
1515 inline int xglobWeak (int i) {
1616 return i*2;
None // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.*address | wc -l | grep 4
0 // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.*address | count 4
11
22 void *test1() {
33 return __builtin_return_address(1);
None // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | wc -l | grep 3
0 // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | count 3
11
22 void test(int* X, char *Y) {
33 memset(X, 4, 1000);
None // RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32( i32} | wc -l | grep 2
1 // RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | wc -l | grep 1
0 // RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32( i32} | count 2
1 // RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1
22
33 unsigned t2(unsigned X) {
44 return __builtin_clz(X);
0 // RUN: %llvmgcc %s -S -o - | llvm-as | opt -std-compile-opts | \
1 // RUN: llvm-dis | grep {foo\[12345\]} | wc -l | grep 5
1 // RUN: llvm-dis | grep {foo\[12345\]} | count 5
22
33 __asm__ ("foo1");
44 __asm__ ("foo2");
0 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xglobWeak | \
1 // RUN: grep weak | wc -l | grep 1
1 // RUN: grep weak | count 1
22 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | \
3 // RUN: grep weak | wc -l | grep 1
3 // RUN: grep weak | count 1
44 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
5 // RUN: grep xWeaknoinline | grep weak | wc -l | grep 1
5 // RUN: grep xWeaknoinline | grep weak | count 1
66 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
7 // RUN: grep xWeakextnoinline | grep weak | wc -l | grep 1
7 // RUN: grep xWeakextnoinline | grep weak | count 1
88 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
99 // RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
10 // RUN: grep -v linkonce | wc -l | grep 1
10 // RUN: grep -v linkonce | count 1
1111 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | \
12 // RUN: grep xstatnoWeak | grep internal | wc -l | grep 1
12 // RUN: grep xstatnoWeak | grep internal | count 1
1313 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep declare | \
1414 // RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
15 // RUN: grep -v linkonce | wc -l | grep 1
15 // RUN: grep -v linkonce | count 1
1616 inline int xglobWeak(int) __attribute__((weak));
1717 inline int xglobWeak (int i) {
1818 return i*2;
0 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | \
1 // RUN: grep xglobWeak | grep extern_weak | wc -l | grep 1
1 // RUN: grep xglobWeak | grep extern_weak | count 1
22 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
3 // RUN: grep xextWeak | grep weak | wc -l | grep 1
3 // RUN: grep xextWeak | grep weak | count 1
44 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
5 // RUN: grep xWeaknoinline | grep weak | wc -l | grep 1
5 // RUN: grep xWeaknoinline | grep weak | count 1
66 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
7 // RUN: grep xWeakextnoinline | grep weak | wc -l | grep 1
7 // RUN: grep xWeakextnoinline | grep weak | count 1
88 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | \
99 // RUN: grep xglobnoWeak | grep -v internal | grep -v weak | \
10 // RUN: grep -v linkonce | wc -l | grep 1
10 // RUN: grep -v linkonce | count 1
1111 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
12 // RUN: grep xstatnoWeak | grep internal | wc -l | grep 1
12 // RUN: grep xstatnoWeak | grep internal | count 1
1313 // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | \
1414 // RUN: grep xextnoWeak | grep -v internal | grep -v weak | \
15 // RUN: grep -v linkonce | wc -l | grep 1
15 // RUN: grep -v linkonce | count 1
1616 inline int xglobWeak(int) __attribute__((weak));
1717 inline int xglobWeak (int i) {
1818 return i*2;
22 void foo(int * __restrict myptr1, int * myptr2) {
33 myptr1[0] = 0;
44 myptr2[0] = 0;
5 }
5 }
None // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep sret | wc -l | grep 5
0 // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep sret | count 5
11
22 struct abc {
33 int a;
None ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | count 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | count 1
22 ; Check that calls to baz and quux are tail-merged.
33
44 ; ModuleID = 'tail.c'
None ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*baz | count 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge | grep bl.*quux | count 1
22 ; Check that calls to baz and quux are tail-merged.
33
44 ; ModuleID = 'tail.c'
None ; RUN: llvm-as < %s | llc -march=arm | grep bl.*baz | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep bl.*quux | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*baz | wc -l | grep 2
3 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*quux | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=arm | grep bl.*baz | count 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep bl.*quux | count 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*baz | count 2
3 ; RUN: llvm-as < %s | llc -march=arm -enable-tail-merge=0 | grep bl.*quux | count 2
44 ; Check that tail merging is the default on ARM, and that -enable-tail-merge=0 works.
55
66 ; ModuleID = 'tail.c'
0 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | \
1 ; RUN: grep {mov r0, r2} | wc -l | grep 1
1 ; RUN: grep {mov r0, r2} | count 1
22 ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | \
3 ; RUN: grep {mov r0, r1} | wc -l | grep 1
3 ; RUN: grep {mov r0, r1} | count 1
44
55 define i32 @f(i32 %a, i64 %b) {
66 %tmp = call i32 @g(i64 %b)
0 ; RUN: llvm-as < %s | llc -march=arm > %t
1 ; RUN: grep and %t | wc -l | grep 1
2 ; RUN: grep orr %t | wc -l | grep 1
3 ; RUN: grep eor %t | wc -l | grep 1
4 ; RUN: grep mov.*lsl %t | wc -l | grep 1
5 ; RUN: grep mov.*asr %t | wc -l | grep 1
1 ; RUN: grep and %t | count 1
2 ; RUN: grep orr %t | count 1
3 ; RUN: grep eor %t | count 1
4 ; RUN: grep mov.*lsl %t | count 1
5 ; RUN: grep mov.*asr %t | count 1
66
77 define i32 @f1(i32 %a, i32 %b) {
88 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {mov r0, #0} | wc -l | grep 1
1 ; RUN: grep {mov r0, #0} | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
3 ; RUN: grep {mov r0, #255$} | wc -l | grep 1
3 ; RUN: grep {mov r0, #255$} | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
5 ; RUN: grep {mov r0.*256} | wc -l | grep 1
5 ; RUN: grep {mov r0.*256} | count 1
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
7 ; RUN: grep {orr.*256} | wc -l | grep 1
7 ; RUN: grep {orr.*256} | count 1
88 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
9 ; RUN: grep {mov r0, .*-1073741761} | wc -l | grep 1
9 ; RUN: grep {mov r0, .*-1073741761} | count 1
1010 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
11 ; RUN: grep {mov r0, .*1008} | wc -l | grep 1
11 ; RUN: grep {mov r0, .*1008} | count 1
1212 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
13 ; RUN: grep {cmp r0, #1, 16} | wc -l | grep 1
13 ; RUN: grep {cmp r0, #1, 16} | count 1
1414
1515 uint %f1() {
1616 ret uint 0
None ; RUN: llvm-as < %s | llc -march=arm | grep bic | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=arm | grep bic | count 2
11 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | \
2 ; RUN: grep fneg | wc -l | grep 2
2 ; RUN: grep fneg | count 2
33
44 define float @test1(float %x, double %y) {
55 %tmp = fpext float %x to double
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 > %t
1 ; RUN: grep fmsr %t | wc -l | grep 4
1 ; RUN: grep fmsr %t | count 4
22 ; RUN: grep fsitos %t
3 ; RUN: grep fmrs %t | wc -l | grep 2
3 ; RUN: grep fmrs %t | count 2
44 ; RUN: grep fsitod %t
5 ; RUN: grep fmrrd %t | wc -l | grep 5
6 ; RUN: grep fmdrr %t | wc -l | grep 2
5 ; RUN: grep fmrrd %t | count 5
6 ; RUN: grep fmdrr %t | count 2
77 ; RUN: grep fldd %t
88 ; RUN: grep fuitod %t
99 ; RUN: grep fuitos %t
33 ; RUN: grep movgt %t
44 ; RUN: grep movge %t
55 ; RUN: grep movne %t
6 ; RUN: grep fcmped %t | wc -l | grep 1
7 ; RUN: grep fcmpes %t | wc -l | grep 6
6 ; RUN: grep fcmped %t | count 1
7 ; RUN: grep fcmpes %t | count 6
88
99 int %f1(float %a) {
1010 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {mov r0, #0} | wc -l | grep 1
1 ; RUN: grep {mov r0, #0} | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
3 ; RUN: grep {flds.*\\\[} | wc -l | grep 1
3 ; RUN: grep {flds.*\\\[} | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
5 ; RUN: grep {fsts.*\\\[} | wc -l | grep 1
5 ; RUN: grep {fsts.*\\\[} | count 1
66
77 float %f1(float %a) {
88 ret float 0.000000e+00
None ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fmrs | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fmrs | count 1
11 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | not grep fmrrd
22
33 @i = weak global i32 0 ; [#uses=2]
0 ; RUN: llvm-as < %s | llc -march=arm
1 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep mov | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep mov | count 1
22 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnu --disable-fp-elim | \
3 ; RUN: grep mov | wc -l | grep 3
4 ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | wc -l | grep 2
3 ; RUN: grep mov | count 3
4 ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep mov | count 2
55
66 @str = internal constant [12 x i8] c"Hello World\00"
77
0 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bx | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bx | count 1
22
33 define i32 @t1(i32 %a, i32 %b) {
44 %tmp2 = icmp eq i32 %a, 0
0 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bxlt | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bxgt | wc -l | grep 1
3 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bxge | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bxlt | count 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bxgt | count 1
3 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bxge | count 1
44
55 define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) {
66 %tmp2 = icmp sgt i32 %c, 10
0 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep cmpne | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bx | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep cmpne | count 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep bx | count 2
33
44 define i32 @t1(i32 %a, i32 %b, i32 %c, i32 %d) {
55 switch i32 %c, label %cond_next [
0 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep subgt | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep suble | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep subgt | count 1
2 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep suble | count 1
33 ; FIXME: Check for # of unconditional branch after adding branch folding post ifcvt.
44
55 define i32 @t(i32 %a, i32 %b) {
0 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep blge | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -enable-arm-if-conversion | grep blge | count 1
22
33 @x = external global i32* ; [#uses=1]
44
11 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion
22 ; RUN: llvm-as < %s | \
33 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \
4 ; RUN: grep cmpne | wc -l | grep 1
4 ; RUN: grep cmpne | count 1
55 ; RUN: llvm-as < %s | \
66 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \
7 ; RUN: grep ldmhi | wc -l | grep 1
7 ; RUN: grep ldmhi | count 1
88
99 define void @foo(i32 %X, i32 %Y) {
1010 entry:
11 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion
22 ; RUN: llvm-as < %s | \
33 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \
4 ; RUN: grep cmpeq | wc -l | grep 1
4 ; RUN: grep cmpeq | count 1
55 ; RUN: llvm-as < %s | \
66 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \
7 ; RUN: grep moveq | wc -l | grep 1
7 ; RUN: grep moveq | count 1
88 ; RUN: llvm-as < %s | \
99 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \
10 ; RUN: grep ldmeq | wc -l | grep 1
10 ; RUN: grep ldmeq | count 1
1111 ; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
1212
1313 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
11 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion
22 ; RUN: llvm-as < %s | \
33 ; RUN: llc -march=arm -mtriple=arm-apple-darwin -enable-arm-if-conversion | \
4 ; RUN: grep ldmne | wc -l | grep 1
4 ; RUN: grep ldmne | count 1
55
66 %struct.SString = type { i8*, i32, i32 }
77
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 |\
2 ; RUN: grep mov | wc -l | grep 3
2 ; RUN: grep mov | count 3
33
44 int %test(int %x) {
55 %tmp = cast int %x to short
0 ; RUN: llvm-as < %s | llc -march=arm
1 ; RUN: llvm-as < %s | llc -march=thumb | grep {ldr.*LCP} | wc -l | grep 5
1 ; RUN: llvm-as < %s | llc -march=thumb | grep {ldr.*LCP} | count 5
22
33 define void @test1() {
44 %tmp = alloca [ 64 x i32 ] , align 4
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep ldmia | wc -l | grep 2
1 ; RUN: grep ldmia | count 2
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
3 ; RUN: grep ldmib | wc -l | grep 1
3 ; RUN: grep ldmib | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | \
5 ; RUN: grep {ldmfd sp\!} | wc -l | grep 3
5 ; RUN: grep {ldmfd sp\!} | count 3
66
77 %X = external global [0 x int]
88
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {ldr r0} | wc -l | grep 3
1 ; RUN: grep {ldr r0} | count 3
22
33 int %f1(int* %v) {
44 entry:
None ; RUN: llvm-as < %s | llc -march=arm | grep ldrb | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep ldrh | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsb | wc -l | grep 1
3 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsh | wc -l | grep 1
4 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | wc -l | grep 1
5 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | wc -l | grep 1
6 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | wc -l | grep 1
7 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm | grep ldrb | count 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep ldrh | count 1
2 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsb | count 1
3 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsh | count 1
4 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrb | count 1
5 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrh | count 1
6 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrsb | count 1
7 ; RUN: llvm-as < %s | llc -march=thumb | grep ldrsh | count 1
88
99 define i32 @test1(i8* %v.pntr.s0.u1) {
1010 %tmp.u = load i8* %v.pntr.s0.u1
0 ; RUN: llvm-as < %s | llc -march=arm | not grep mov
1 ; RUN: llvm-as < %s | llc -march=thumb | grep cpy | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=thumb | grep cpy | count 2
22
33 define i32 @f1() {
44 %buf = alloca [32 x i32], align 4
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {ldr.*\\\[.*\],} | wc -l | grep 1
1 ; RUN: grep {ldr.*\\\[.*\],} | count 1
22
33 int %test(int %a, int %b, int %c) {
44 %tmp1 = mul int %a, %b
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {ldr.*\\!} | wc -l | grep 2
1 ; RUN: grep {ldr.*\\!} | count 2
22
33 int *%test1(int *%X, int *%dest) {
44 %Y = getelementptr int* %X, int 4
22 ; RUN: not grep {L_G\$non_lazy_ptr}
33 ; RUN: llvm-as < %s | \
44 ; RUN: llc -mtriple=arm-apple-darwin -relocation-model=dynamic-no-pic | \
5 ; RUN: grep {L_G\$non_lazy_ptr} | wc -l | grep 2
5 ; RUN: grep {L_G\$non_lazy_ptr} | count 2
66 ; RUN: llvm-as < %s | \
77 ; RUN: llc -mtriple=arm-apple-darwin -relocation-model=pic | \
8 ; RUN: grep {ldr.*pc} | wc -l | grep 1
8 ; RUN: grep {ldr.*pc} | count 1
99 ; RUN: llvm-as < %s | \
1010 ; RUN: llc -mtriple=arm-linux-gnueabi -relocation-model=pic | \
11 ; RUN: grep {GOT} | wc -l | grep 1
11 ; RUN: grep {GOT} | count 1
1212
1313 @G = external global i32
1414
None ; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=thumb | grep cmp | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm | grep cmp | count 1
1 ; RUN: llvm-as < %s | llc -march=thumb | grep cmp | count 1
22
33
44 define i1 @t1(i64 %x) {
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep -- {-2147483648} | wc -l | grep 3
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mvn | wc -l | grep 3
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep adds | wc -l | grep 1
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep adc | wc -l | grep 1
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep {subs } | wc -l | grep 1
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep sbc | wc -l | grep 1
1 ; RUN: grep -- {-2147483648} | count 3
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mvn | count 3
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep adds | count 1
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep adc | count 1
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep {subs } | count 1
6 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep sbc | count 1
77 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
8 ; RUN: grep smull | wc -l | grep 1
8 ; RUN: grep smull | count 1
99 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
10 ; RUN: grep umull | wc -l | grep 1
10 ; RUN: grep umull | count 1
1111 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=thumb | \
12 ; RUN: grep mvn | wc -l | grep 1
12 ; RUN: grep mvn | count 1
1313 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=thumb | \
14 ; RUN: grep adc | wc -l | grep 1
14 ; RUN: grep adc | count 1
1515 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=thumb | \
16 ; RUN: grep sbc | wc -l | grep 1
16 ; RUN: grep sbc | count 1
1717 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=thumb | grep __muldi3
1818 ; END.
1919
0 ; RUN: llvm-as < %s | llc -march=thumb
11 ; RUN: llvm-as < %s | llc -march=arm > %t
2 ; RUN: grep rrx %t | wc -l | grep 1
2 ; RUN: grep rrx %t | count 1
33 ; RUN: grep __ashldi3 %t
44 ; RUN: grep __ashrdi3 %t
55 ; RUN: grep __lshrdi3 %t
None ; RUN: llvm-as < %s | llc -march=arm | grep mul | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=arm | grep lsl | wc -l | grep 2
2 ; RUN: llvm-as < %s | llc -march=thumb | grep mul | wc -l | grep 3
3 ; RUN: llvm-as < %s | llc -march=thumb | grep lsl | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm | grep mul | count 2
1 ; RUN: llvm-as < %s | llc -march=arm | grep lsl | count 2
2 ; RUN: llvm-as < %s | llc -march=thumb | grep mul | count 3
3 ; RUN: llvm-as < %s | llc -march=thumb | grep lsl | count 1
44
55 define i32 @f1(i32 %u) {
66 %tmp = mul i32 %u, %u
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
2 ; RUN: grep smmul | wc -l | grep 1
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep umull | wc -l | grep 1
2 ; RUN: grep smmul | count 1
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep umull | count 1
44
55 int %smulhi(int %x, int %y) {
66 %tmp = cast int %x to ulong ; [#uses=1]
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mvn | wc -l | grep 8
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mvn | count 8
11 ; END.
22
33 int %f1() {
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
1 ; RUN: grep pkhbt | wc -l | grep 5
1 ; RUN: grep pkhbt | count 5
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
3 ; RUN: grep pkhtb | wc -l | grep 4
3 ; RUN: grep pkhtb | count 4
44 ; END.
55
66 implementation ; Functions:
None ; RUN: llvm-as < %s | llc -march=arm | grep moveq | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep movgt | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm | grep movlt | wc -l | grep 3
3 ; RUN: llvm-as < %s | llc -march=arm | grep movle | wc -l | grep 1
4 ; RUN: llvm-as < %s | llc -march=arm | grep movls | wc -l | grep 1
5 ; RUN: llvm-as < %s | llc -march=arm | grep movhi | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm | grep moveq | count 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep movgt | count 1
2 ; RUN: llvm-as < %s | llc -march=arm | grep movlt | count 3
3 ; RUN: llvm-as < %s | llc -march=arm | grep movle | count 1
4 ; RUN: llvm-as < %s | llc -march=arm | grep movls | count 1
5 ; RUN: llvm-as < %s | llc -march=arm | grep movhi | count 1
66 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
7 ; RUN: grep fcpydmi | wc -l | grep 1
8 ; RUN: llvm-as < %s | llc -march=thumb | grep beq | wc -l | grep 1
9 ; RUN: llvm-as < %s | llc -march=thumb | grep bgt | wc -l | grep 1
10 ; RUN: llvm-as < %s | llc -march=thumb | grep blt | wc -l | grep 3
11 ; RUN: llvm-as < %s | llc -march=thumb | grep ble | wc -l | grep 1
12 ; RUN: llvm-as < %s | llc -march=thumb | grep bls | wc -l | grep 1
13 ; RUN: llvm-as < %s | llc -march=thumb | grep bhi | wc -l | grep 1
7 ; RUN: grep fcpydmi | count 1
8 ; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
9 ; RUN: llvm-as < %s | llc -march=thumb | grep bgt | count 1
10 ; RUN: llvm-as < %s | llc -march=thumb | grep blt | count 3
11 ; RUN: llvm-as < %s | llc -march=thumb | grep ble | count 1
12 ; RUN: llvm-as < %s | llc -march=thumb | grep bls | count 1
13 ; RUN: llvm-as < %s | llc -march=thumb | grep bhi | count 1
1414 ; RUN: llvm-as < %s | llc -march=thumb | grep __ltdf2
1515
1616 define i32 @f1(i32 %a.s) {
0 ; RUN: llvm-as < %s | llc -march=arm
1 ; RUN: llvm-as < %s | llc -march=arm | grep mov | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=arm | grep mov | count 2
22
33 define i32 @t1(i32 %a, i32 %b, i32 %c) {
44 %tmp1 = icmp sgt i32 %c, 10
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5TE
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5TE | \
3 ; RUN: grep smulbt | wc -l | grep 1
3 ; RUN: grep smulbt | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5TE | \
5 ; RUN: grep smultt | wc -l | grep 1
5 ; RUN: grep smultt | count 1
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v5TE | \
7 ; RUN: grep smlabt | wc -l | grep 1
7 ; RUN: grep smlabt | count 1
88
99 %x = weak global short 0
1010 %y = weak global short 0
0 ; RUN: llvm-as < %s | llc -march=arm
1 ; RUN: llvm-as < %s | llc -march=arm | grep add | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep add | count 1
22 ; RUN: llvm-as < %s | llc -march=thumb
3 ; RUN: llvm-as < %s | llc -march=thumb | grep add | wc -l | grep 1
3 ; RUN: llvm-as < %s | llc -march=thumb | grep add | count 1
44
55 define void @f1() {
66 %c = alloca i8, align 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {strh .*\\\[.*\], #-4} | wc -l | grep 1
1 ; RUN: grep {strh .*\\\[.*\], #-4} | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
3 ; RUN: grep {str .*\\\[.*\],} | wc -l | grep 1
3 ; RUN: grep {str .*\\\[.*\],} | count 1
44
55 short %test1(int *%X, short *%A) {
66 %Y = load int* %X
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep {str.*\\!} | wc -l | grep 2
1 ; RUN: grep {str.*\\!} | count 2
22
33 void %test1(int *%X, int *%A, int **%dest) {
44 %B = load int* %A
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
1 ; RUN: grep strb | wc -l | grep 1
1 ; RUN: grep strb | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | \
3 ; RUN: grep strh | wc -l | grep 1
3 ; RUN: grep strh | count 1
44
55 void %test1(int %v, short* %ptr) {
66 %tmp = cast int %v to short
0 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
1 ; RUN: grep sxtb | wc -l | grep 1
1 ; RUN: grep sxtb | count 1
22 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
3 ; RUN: grep sxtab | wc -l | grep 1
3 ; RUN: grep sxtab | count 1
44
55 define i8 @test1(i32 %A) signext {
66 %B = lshr i32 %A, 8
None ; RUN: llvm-as < %s | llc -march=arm | grep ldrb.*7 | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsb.*7 | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm | grep ldrb.*7 | count 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep ldrsb.*7 | count 1
22
33 %struct.A = type { i8, i8, i8, i8, i16, i8, i8, %struct.B** }
44 %struct.B = type { float, float, i32, i32, i32, [0 x i8] }
None ; RUN: llvm-as < %s | llc -march=arm | grep movne | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep moveq | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=thumb | grep bne | wc -l | grep 1
3 ; RUN: llvm-as < %s | llc -march=thumb | grep beq | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm | grep movne | count 1
1 ; RUN: llvm-as < %s | llc -march=arm | grep moveq | count 1
2 ; RUN: llvm-as < %s | llc -march=thumb | grep bne | count 1
3 ; RUN: llvm-as < %s | llc -march=thumb | grep beq | count 1
44
55 define i32 @f1(float %X, float %Y) {
66 %tmp = fcmp uno float %X, %Y
None ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxtb | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxtab | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxth | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxtb | count 1
1 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxtab | count 1
2 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep uxth | count 1
33
44 define i8 @test1(i32 %A.u) zeroext {
55 %B.u = trunc i32 %A.u to i8
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
1 ; RUN: grep uxt | wc -l | grep 10
1 ; RUN: grep uxt | count 10
22 ; END.
33
44 uint %test1(uint %x) {
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=thumb
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=thumb | \
2 ; RUN: grep pop | wc -l | grep 2
2 ; RUN: grep pop | count 2
33
44 %str = internal constant [4 x sbyte] c"%d\0A\00" ; <[4 x sbyte]*> [#uses=1]
55
0 ; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | \
1 ; RUN: grep {add sp, sp, #16} | wc -l | grep 1
1 ; RUN: grep {add sp, sp, #16} | count 1
22 ; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu | \
3 ; RUN: grep {add sp, sp, #12} | wc -l | grep 2
3 ; RUN: grep {add sp, sp, #12} | count 2
44
55 define i32 @f(i32 %a, ...) {
66 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
1 ; RUN: grep fabs | wc -l | grep 2
1 ; RUN: grep fabs | count 2
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
3 ; RUN: grep fmscs | wc -l | grep 1
3 ; RUN: grep fmscs | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
5 ; RUN: grep fcvt | wc -l | grep 2
5 ; RUN: grep fcvt | count 2
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
7 ; RUN: grep fuito | wc -l | grep 2
7 ; RUN: grep fuito | count 2
88 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
9 ; RUN: grep fto.i | wc -l | grep 4
9 ; RUN: grep fto.i | count 4
1010 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
11 ; RUN: grep bmi | wc -l | grep 1
11 ; RUN: grep bmi | count 1
1212 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
13 ; RUN: grep bgt | wc -l | grep 1
13 ; RUN: grep bgt | count 1
1414 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+vfp2 | \
15 ; RUN: grep fcmpezs | wc -l | grep 1
15 ; RUN: grep fcmpezs | count 1
1616
1717 void %test(float *%P, double* %D) {
1818 %A = load float* %P
0 ; There should be exactly two calls here (memset and malloc), no more.
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep jsr | wc -l | grep 2
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep jsr | count 2
22
33 %typedef.bc_struct = type opaque
44
0 ;test all the shifted and signextending adds and subs with and without consts
11 ;
22 ; RUN: llvm-as < %s | llc -march=alpha -o %t.s -f
3 ; RUN: grep { addl} %t.s | wc -l | grep 2
4 ; RUN: grep { addq} %t.s | wc -l | grep 2
5 ; RUN: grep { subl} %t.s | wc -l | grep 2
6 ; RUN: grep { subq} %t.s | wc -l | grep 1
3 ; RUN: grep { addl} %t.s | count 2
4 ; RUN: grep { addq} %t.s | count 2
5 ; RUN: grep { subl} %t.s | count 2
6 ; RUN: grep { subq} %t.s | count 1
77 ;
8 ; RUN: grep {lda \$0,-100(\$16)} %t.s | wc -l | grep 1
9 ; RUN: grep {s4addl} %t.s | wc -l | grep 2
10 ; RUN: grep {s8addl} %t.s | wc -l | grep 2
11 ; RUN: grep {s4addq} %t.s | wc -l | grep 2
12 ; RUN: grep {s8addq} %t.s | wc -l | grep 2
8 ; RUN: grep {lda \$0,-100(\$16)} %t.s | count 1
9 ; RUN: grep {s4addl} %t.s | count 2
10 ; RUN: grep {s8addl} %t.s | count 2
11 ; RUN: grep {s4addq} %t.s | count 2
12 ; RUN: grep {s8addq} %t.s | count 2
1313 ;
14 ; RUN: grep {s4subl} %t.s | wc -l | grep 2
15 ; RUN: grep {s8subl} %t.s | wc -l | grep 2
16 ; RUN: grep {s4subq} %t.s | wc -l | grep 2
17 ; RUN: grep {s8subq} %t.s | wc -l | grep 2
14 ; RUN: grep {s4subl} %t.s | count 2
15 ; RUN: grep {s8subl} %t.s | count 2
16 ; RUN: grep {s4subq} %t.s | count 2
17 ; RUN: grep {s8subq} %t.s | count 2
1818
1919
2020 define i32 @al(i32 signext %x.s, i32 signext %y.s) signext {
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmpbge | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha | grep cmpbge | count 2
11
22 bool %test1(ulong %A, ulong %B) {
33 %C = and ulong %A, 255
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | \
1 ; RUN: grep __BITCAST | wc -l | grep 14
1 ; RUN: grep __BITCAST | count 14
22
33 int %test1(float %F) {
44 %X = bitcast float %F to int
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | count 1
11 ; PR964
22
33 sbyte* %FindChar(sbyte* %CurPtr) {
0 ; PR1296
1 ; RUN: llvm-as < %s | llc -march=x86 | grep {movl \$1} | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=x86 | grep {movl \$1} | count 1
22
33 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
44 target triple = "i686-apple-darwin8"
0 ; PR925
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
2 ; RUN: grep mov.*str1 | wc -l | grep 1
2 ; RUN: grep mov.*str1 | count 1
33
44 target endian = little
55 target pointersize = 32
0 ; RUN: llvm-as < %s | llc -march=x86 -o %t -f
1 ; RUN: grep jb %t | wc -l | grep 1
2 ; RUN: grep \\\$6 %t | wc -l | grep 2
3 ; RUN: grep 1024 %t | wc -l | grep 1
4 ; RUN: grep 1023 %t | wc -l | grep 1
5 ; RUN: grep 119 %t | wc -l | grep 1
6 ; RUN: grep JTI %t | wc -l | grep 2
7 ; RUN: grep jg %t | wc -l | grep 1
8 ; RUN: grep ja %t | wc -l | grep 1
9 ; RUN: grep js %t | wc -l | grep 1
1 ; RUN: grep jb %t | count 1
2 ; RUN: grep \\\$6 %t | count 2
3 ; RUN: grep 1024 %t | count 1
4 ; RUN: grep 1023 %t | count 1
5 ; RUN: grep 119 %t | count 1
6 ; RUN: grep JTI %t | count 2
7 ; RUN: grep jg %t | count 1
8 ; RUN: grep ja %t | count 1
9 ; RUN: grep js %t | count 1
1010
1111 target triple = "i686-pc-linux-gnu"
1212
None ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1
3 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2
4 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | count 1
1 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | count 1
2 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | count 1
3 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | count 2
4 ; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | count 1
55
66 define i32 @main(i32 %tmp158) {
77 entry:
0 ; This function should have exactly one call to fixdfdi, no more!
11
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mattr=-64bit | \
3 ; RUN: grep {bl .*fixdfdi} | wc -l | grep 1
3 ; RUN: grep {bl .*fixdfdi} | count 1
44
55 double %test2(double %tmp.7705) {
66 %mem_tmp.2.0.in = cast double %tmp.7705 to long ; [#uses=1]
None ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc64-apple-darwin | grep extsw | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=powerpc64-apple-darwin | grep extsw | count 2
11
22 %lens = external global ubyte*
33 %vals = external global int*
None ; RUN: llvm-as < %s | llc | grep mflr | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc | grep mflr | count 1
11
22 target datalayout = "e-p:32:32"
33 target triple = "powerpc-apple-darwin8"
None ; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*baz | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*quux | wc -l | grep 2
2 ; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge | grep bl.*baz | wc -l | grep 1
3 ; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge=1 | grep bl.*quux | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*baz | count 2
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep bl.*quux | count 2
2 ; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge | grep bl.*baz | count 1
3 ; RUN: llvm-as < %s | llc -march=ppc32 -enable-tail-merge=1 | grep bl.*quux | count 1
44 ; Check that tail merging is not the default on ppc, and that -enable-tail-merge works.
55
66 ; ModuleID = 'tail.c'
0 ; All of these should be codegen'd without loading immediates
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
2 ; RUN: grep addc %t | wc -l | grep 1
3 ; RUN: grep adde %t | wc -l | grep 1
4 ; RUN: grep addze %t | wc -l | grep 1
5 ; RUN: grep addme %t | wc -l | grep 1
6 ; RUN: grep addic %t | wc -l | grep 2
2 ; RUN: grep addc %t | count 1
3 ; RUN: grep adde %t | count 1
4 ; RUN: grep addze %t | count 1
5 ; RUN: grep addme %t | count 1
6 ; RUN: grep addic %t | count 2
77
88 implementation ; Functions:
99
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
1 ; RUN: grep align.4 | wc -l | grep 1
1 ; RUN: grep align.4 | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
3 ; RUN: grep align.2 | wc -l | grep 1
3 ; RUN: grep align.2 | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
5 ; RUN: grep align.3 | wc -l | grep 1
5 ; RUN: grep align.3 | count 1
66
77
88 %A = global <4 x uint> < uint 10, uint 20, uint 30, uint 40 >
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
1 ; RUN: grep {b LBB.*} | wc -l | grep 4
1 ; RUN: grep {b LBB.*} | count 4
22
33 target endian = big
44 target pointersize = 32
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
1 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | wc -l | grep 4
1 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | count 4
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwinm
33 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep rlwimi
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | \
5 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | wc -l | grep 4
5 ; RUN: grep {stwbrx\\|lwbrx\\|sthbrx\\|lhbrx} | count 4
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwinm
77 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 | not grep rlwimi
88
0 ; There should be exactly one vxor here.
11 ; RUN: llvm-upgrade < %s | llvm-as | \
22 ; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
3 ; RUN: grep vxor | wc -l | grep 1
3 ; RUN: grep vxor | count 1
44
55 ; There should be exactly one vsplti here.
66 ; RUN: llvm-upgrade < %s | llvm-as | \
77 ; RUN: llc -march=ppc32 -mcpu=g5 --enable-unsafe-fp-math | \
8 ; RUN: grep vsplti | wc -l | grep 1
8 ; RUN: grep vsplti | count 1
99
1010
1111 void %VXOR(<4 x float>* %P1, <4 x int>* %P2, <4 x float>* %P3) {
0 ; Test various forms of calls.
11
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
3 ; RUN: grep {bl } | wc -l | grep 2
3 ; RUN: grep {bl } | count 2
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
5 ; RUN: grep {bctrl} | wc -l | grep 1
5 ; RUN: grep {bctrl} | count 1
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
7 ; RUN: grep {bla } | wc -l | grep 1
7 ; RUN: grep {bla } | count 1
88
99 declare void %foo()
1010
0 ; All of these routines should be perform optimal load of constants.
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
2 ; RUN: grep lis | wc -l | grep 5
2 ; RUN: grep lis | count 5
33 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
4 ; RUN: grep ori | wc -l | grep 3
4 ; RUN: grep ori | count 3
55 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
6 ; RUN: grep {li } | wc -l | grep 4
6 ; RUN: grep {li } | count 4
77
88 implementation ; Functions:
99
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
1 ; RUN: grep eqv | wc -l | grep 3
1 ; RUN: grep eqv | count 3
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \
3 ; RUN: grep andc | wc -l | grep 3
3 ; RUN: grep andc | count 3
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
5 ; RUN: grep orc | wc -l | grep 2
5 ; RUN: grep orc | count 2
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \
7 ; RUN: grep nor | wc -l | grep 3
7 ; RUN: grep nor | count 3
88 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
9 ; RUN: grep nand | wc -l | grep 1
9 ; RUN: grep nand | count 1
1010
1111 int %EQV1(int %X, int %Y) {
1212 %A = xor int %X, %Y
0 ; This should turn into a single extsh
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep extsh | wc -l | grep 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep extsh | count 1
22 int %test(int %X) {
33 %tmp.81 = shl int %X, ubyte 16 ; [#uses=1]
44 %tmp.82 = shr int %tmp.81, ubyte 16 ; [#uses=1]
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
1 ; RUN: egrep {fn?madd|fn?msub} | wc -l | grep 8
1 ; RUN: egrep {fn?madd|fn?msub} | count 8
22
33 double %test_FMADD1(double %A, double %B, double %C) {
44 %D = mul double %A, %B
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep fcmp | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep fcmp | count 1
11
22 declare bool %llvm.isunordered.f64(double, double)
33
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep fctiwz | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep fctiwz | count 1
11
22 implementation
33
22 ; RUN: not grep mulhwu %t
33 ; RUN: not grep srawi %t
44 ; RUN: not grep add %t
5 ; RUN: grep mulhw %t | wc -l | grep 1
5 ; RUN: grep mulhw %t | count 1
66
77 implementation ; Functions:
88
0 ; All of these ands and shifts should be folded into rlwimi's
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep and
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi | wc -l | grep 8
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | grep rlwimi | count 8
33
44 implementation ; Functions:
55
0 ; All of these ands and shifts should be folded into rlwimi's
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
2 ; RUN: grep rlwimi %t | wc -l | grep 3
3 ; RUN: grep srwi %t | wc -l | grep 1
2 ; RUN: grep rlwimi %t | count 3
3 ; RUN: grep srwi %t | count 1
44 ; RUN: not grep slwi %t
55
66 implementation ; Functions:
33 ; RUN: not grep srawi %t
44 ; RUN: not grep srwi %t
55 ; RUN: not grep slwi %t
6 ; RUN: grep rlwinm %t | wc -l | grep 8
6 ; RUN: grep rlwinm %t | count 8
77
88 implementation ; Functions:
99
33 ; RUN: not grep srawi %t
44 ; RUN: not grep srwi %t
55 ; RUN: not grep slwi %t
6 ; RUN: grep rlwnm %t | wc -l | grep 1
7 ; RUN: grep rlwinm %t | wc -l | grep 1
6 ; RUN: grep rlwnm %t | count 1
7 ; RUN: grep rlwinm %t | count 1
88
99 define i32 @test1(i32 %X, i32 %Y) {
1010 entry:
None ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 4
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | count 4
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | count 2
22 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep or
33
44 define i32 @rotl32(i32 %A, i8 %Amt) {
None ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | count 2
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | count 2
22
33 define i32 @rotlw(i32 %x, i32 %sh) {
44 entry:
0 ; All of these should be codegen'd without loading immediates
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
2 ; RUN: grep subfc %t | wc -l | grep 1
3 ; RUN: grep subfe %t | wc -l | grep 1
4 ; RUN: grep subfze %t | wc -l | grep 1
5 ; RUN: grep subfme %t | wc -l | grep 1
6 ; RUN: grep subfic %t | wc -l | grep 2
2 ; RUN: grep subfc %t | count 1
3 ; RUN: grep subfe %t | count 1
4 ; RUN: grep subfze %t | count 1
5 ; RUN: grep subfme %t | count 1
6 ; RUN: grep subfic %t | count 2
77 implementation ; Functions:
88
99 long %sub_ll(long %a, long %b) {
None ; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | count 2
11 ; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | \
2 ; RUN: grep fmul | wc -l | grep 1
2 ; RUN: grep fmul | count 1
33
44 define double @foo(double %X) {
55 %tmp1 = mul double %X, 1.23
0 ; This should fold the "vcmpbfp." and "vcmpbfp" instructions into a single
11 ; "vcmpbfp.".
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vcmpbfp | wc -l | grep 1
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | grep vcmpbfp | count 1
33
44 void %test(<4 x float>* %x, <4 x float>* %y, int* %P) {
55 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | \
11 ; RUN: llc -march=ppc32 -mcpu=g5 | not grep vperm
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 > %t
3 ; RUN: grep vsldoi %t | wc -l | grep 2
4 ; RUN: grep vmrgh %t | wc -l | grep 7
5 ; RUN: grep vmrgl %t | wc -l | grep 6
6 ; RUN: grep vpkuhum %t | wc -l | grep 1
7 ; RUN: grep vpkuwum %t | wc -l | grep 1
3 ; RUN: grep vsldoi %t | count 2
4 ; RUN: grep vmrgh %t | count 7
5 ; RUN: grep vmrgl %t | count 6
6 ; RUN: grep vpkuhum %t | count 1
7 ; RUN: grep vpkuwum %t | count 1
88
99 void %VSLDOI_xy(<8 x short>* %A, <8 x short>* %B) {
1010 entry:
0 ; Test that vectors are scalarized/lowered correctly.
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g3 | \
2 ; RUN: grep stfs | wc -l | grep 4
2 ; RUN: grep stfs | count 4
33 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 -o %t -f
4 ; RUN: grep vspltw %t | wc -l | grep 2
5 ; RUN: grep vsplti %t | wc -l | grep 3
6 ; RUN: grep vsplth %t | wc -l | grep 1
4 ; RUN: grep vspltw %t | count 2
5 ; RUN: grep vsplti %t | count 3
6 ; RUN: grep vsplth %t | count 1
77
88 %f4 = type <4 x float>
99 %i4 = type <4 x int>
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=sparc | \
1 ; RUN: grep xnor | wc -l | grep 2
1 ; RUN: grep xnor | count 2
22
33 int %test1(int %X, int %Y) {
44 %A = xor int %X, %Y
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
1 ; RUN: grep shld | wc -l | grep 1
1 ; RUN: grep shld | count 1
22 ;
33 ; Check that the isel does not fold the shld, which already folds a load
44 ; and has two uses, into a store.
0 ; RUN: llvm-upgrade < %s | llvm-as | \
11 ; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
2 ; RUN: grep {movl _last} | wc -l | grep 1
2 ; RUN: grep {movl _last} | count 1
33 ; RUN: llvm-upgrade < %s | llvm-as | \
44 ; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
5 ; RUN: grep {cmpl.*_last} | wc -l | grep 1
5 ; RUN: grep {cmpl.*_last} | count 1
66
77 %block = external global ubyte* ; [#uses=1]
88 %last = external global int ; [#uses=3]
0 ; PR1022, PR1023
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
2 ; RUN: grep 3721182122 | wc -l | grep 2
2 ; RUN: grep 3721182122 | count 2
33 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
4 ; RUN: grep -E {movl _?bytes2} | wc -l | grep 1
4 ; RUN: grep -E {movl _?bytes2} | count 1
55
66 %fmt = constant [4 x sbyte] c"%x\0A\00"
77 %bytes = constant [4 x sbyte] c"\AA\BB\CC\DD"
0 ; PR1075
11 ; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | \
2 ; RUN: %prcontext {mulss LCPI1_3} 1 | grep mulss | wc -l | grep 1
2 ; RUN: %prcontext {mulss LCPI1_3} 1 | grep mulss | count 1
33
44 define float @foo(float %x) {
55 %tmp1 = mul float %x, 3.000000e+00
0 ; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-darwin | \
1 ; RUN: grep push | wc -l | grep 3
1 ; RUN: grep push | count 3
22
33 define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) {
44 entry:
None ; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep paddq | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep movq | wc -l | grep 3
0 ; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep paddq | count 2
1 ; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep movq | count 3
22
33 define <1 x i64> @unsigned_add3(<1 x i64>* %a, <1 x i64>* %b, i32 %count) {
44 entry:
None ; RUN: llvm-as < %s | llc -mcpu=i686 | grep jmp | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -mcpu=i686 | grep jmp | count 1
11 ; check that branch folding understands FP_REG_KILL is not a branch
22 ; the remaining jmp can be removed if we take advantage of knowing
33 ; abort does not return
1919
2020 return: ; preds = %bb, %entry
2121 ret void
22 }
22 }
66 store i32 %x, i32* @X, align 4
77 %retval67 = trunc i32 %x to i8 ; [#uses=1]
88 ret i8 %retval67
9 }
9 }
None ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | wc -l | grep 5
0 ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | count 5
11
22 %struct..0anon = type { i32 }
33 %struct.rtvec_def = type { i32, [1 x %struct..0anon] }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep and | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep and | count 1
11
22 ; The dag combiner should fold together (x&127)|(y&16711680) -> (x|y)&c1
33 ; in this case.
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 2
11 ; RUN: llvm-as < %s | llc -march=x86-64 | not grep rsp
22
33 define i64 @test1(double %A) {
0 ; bswap should be constant folded when it is passed a constant argument
11
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
3 ; RUN: grep bswapl | wc -l | grep 3
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rolw | wc -l | grep 1
3 ; RUN: grep bswapl | count 3
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rolw | count 1
55
66 declare ushort %llvm.bswap.i16(ushort)
77 declare uint %llvm.bswap.i32(uint)
None ; RUN: llvm-as < %s | llc -march=x86 -disable-fp-elim | grep subl | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86 -disable-fp-elim | grep subl | count 1
11
22 %struct.decode_t = type { i8, i8, i8, i8, i16, i8, i8, %struct.range_t** }
33 %struct.range_t = type { float, float, i32, i32, i32, [0 x i8] }
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep test | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | count 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep test | count 1
22
33 int %f1(int %X, int* %y) {
44 %tmp = load int* %y
22
33 ; Make sure there are only 3 mov's for each testcase
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
5 ; RUN: grep {\\\} | wc -l | grep 6
5 ; RUN: grep {\\\} | count 6
66
77
88 target triple = "i686-pc-linux-gnu"
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \
1 ; RUN: grep movsd | wc -l | grep 1
1 ; RUN: grep movsd | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \
33 ; RUN: grep ucomisd
44 declare bool %llvm.isunordered.f64(double,double)
None ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$bar) | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$qux) | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$hen) | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$bar) | count 1
1 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$qux) | count 1
2 ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$hen) | count 1
33 ; PR1339
44
55 @"$bar" = global i32 zeroinitializer
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movzx | wc -l | grep 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movsx | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movzx | count 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movsx | count 1
22
33 %G1 = internal global ubyte 0 ; [#uses=1]
44 %G2 = internal global sbyte 0 ; [#uses=1]
None ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=i686-apple-darwin | grep weak_reference | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=i686-apple-darwin | grep weak_reference | count 2
11
22 %Y = global int (sbyte*)* %X
33 declare extern_weak int %X(sbyte*)
0 ; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
11 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=-sse2,-sse3 | \
2 ; RUN: grep fabs\$ | wc -l | grep 1
2 ; RUN: grep fabs\$ | count 1
33 ; RUN: llvm-upgrade < %s | llvm-as | \
44 ; RUN: llc -march=x86 -mattr=-sse2,-sse3 -enable-unsafe-fp-math | \
5 ; RUN: grep fabs\$ | wc -l | grep 2
5 ; RUN: grep fabs\$ | count 2
66
77 target endian = little
88 target pointersize = 32
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att -mattr=-sse2 | grep fildll | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att -mattr=-sse2 | grep fildll | count 2
11
22 fastcc double %sint64_to_fp(long %X) {
33 %R = cast long %X to double
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t
2 ; RUN: grep fldl %t | wc -l | grep 1
2 ; RUN: grep fldl %t | count 1
33 ; RUN: not grep xmm %t
4 ; RUN: grep {sub.*esp} %t | wc -l | grep 1
4 ; RUN: grep {sub.*esp} %t | count 1
55
66 ; These testcases shouldn't require loading into an XMM register then storing
77 ; to memory, then reloading into an FPStack reg.
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -enable-unsafe-fp-math | \
1 ; RUN: grep -v sp | grep xorps | wc -l | grep 2
1 ; RUN: grep -v sp | grep xorps | count 2
22
33 ; Don't fold the incoming stack arguments into the xorps instructions used
44 ; to do floating-point negations, because the arguments aren't vectors
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | wc -l | grep 12
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | count 12
11
22 ; This testcase was written to demonstrate an instruction-selection problem,
33 ; however it also happens to expose a limitation in the DAGCombiner's
None ; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=x86 | grep xor | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 1
1 ; RUN: llvm-as < %s | llc -march=x86 | grep shr | count 1
2 ; RUN: llvm-as < %s | llc -march=x86 | grep xor | count 1
33
44 define i1 @t1(i64 %x) {
55 %B = icmp slt i64 %x, 0
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
1 ; RUN: grep {A(} | wc -l | grep 1
1 ; RUN: grep {A(} | count 1
22 ;
33 ; Make sure the common loop invariant _A(reg) is hoisted up to preheader.
44
0 ; RUN: llvm-as < %s | llc -o %t -f
1 ; RUN: grep __alloca %t | wc -l | grep 2
1 ; RUN: grep __alloca %t | count 2
22 ; RUN: grep 8028 %t
33 ; RUN: grep {pushl %eax} %t
4 ; RUN: grep 8024 %t | wc -l | grep 2
4 ; RUN: grep 8024 %t | count 2
55
66 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
77 target triple = "i386-mingw32"
None ; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep movq | wc -l | grep 3
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep movq | count 3
11
22 ; FIXME: This code outputs:
33 ;
None ; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep punpckhdq | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep punpckhdq | count 1
11
22 define void @bork(<1 x i64>* %x) {
33 entry:
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | count 2
11
22 define float @foo(<4 x float> %a) {
33 %b = insertelement <4 x float> %a, float 0.0, i32 3
None ; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 1082126238 | wc -l | grep 3
1 ; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 3058016715 | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 1082126238 | count 3
1 ; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 3058016715 | count 1
22 ;; magic constants are 3.999f and half of 3.999
33 ; ModuleID = '1489.c'
44 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
None ; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | wc -l | grep 4
1 ; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | wc -l | grep 3
0 ; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | count 4
1 ; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | count 3
22
33 ; ModuleID = ''
44 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {ro\[rl\]} | wc -l | grep 12
1 ; RUN: grep {ro\[rl\]} | count 12
22
33 uint %rotl32(uint %A, ubyte %Amt) {
44 %B = shl uint %A, ubyte %Amt
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep min | wc -l | grep 1
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep max | wc -l | grep 1
2 ; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep min | count 1
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep max | count 1
2 ; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 2
33
44 declare float @bar()
55
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \
1 ; RUN: grep mins | wc -l | grep 3
1 ; RUN: grep mins | count 3
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \
3 ; RUN: grep maxs | wc -l | grep 2
3 ; RUN: grep maxs | count 2
44
55 declare bool %llvm.isunordered.f64( double %x, double %y )
66 declare bool %llvm.isunordered.f32( float %x, float %y )
0 ; RUN: llvm-as < %s | llc -relocation-model=static -march=x86 | \
1 ; RUN: grep {shll \$3} | wc -l | grep 2
1 ; RUN: grep {shll \$3} | count 2
22
33 ; This should produce two shll instructions, not any lea's.
44
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {sh\[lr\]d} | wc -l | grep 5
1 ; RUN: grep {sh\[lr\]d} | count 5
22
33 long %test1(long %X, ubyte %C) {
44 %Y = shl long %X, ubyte %C
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
1 ; RUN: grep {s\[ah\]\[rl\]l} | wc -l | grep 1
1 ; RUN: grep {s\[ah\]\[rl\]l} | count 1
22
33 int* %test1(int *%P, uint %X) {
44 %Y = shr uint %X, ubyte 2
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
11
22 define <4 x float> @foo(<4 x float>* %p)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
11
22 define <2 x i64> @bar(<2 x i64>* %p)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep unpck | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep shuf | wc -l | grep 2
2 ; RUN: llvm-as < %s | llc -march=x86-64 | grep ps | wc -l | grep 4
3 ; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | wc -l | grep 4
4 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 4
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep unpck | count 2
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep shuf | count 2
2 ; RUN: llvm-as < %s | llc -march=x86-64 | grep ps | count 4
3 ; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | count 4
4 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 4
55
66 define <4 x float> @a(<4 x float>* %y)
77 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
11
22 define <4 x float> @foo(<4 x float>* %p, <4 x float> %x)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
11
22 define void @foo(<4 x float>* %p, <4 x float> %x)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
11
22 define void @foo(<4 x float>* %p, <4 x float> %x)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
11
22 define <2 x i64> @bar(<2 x i64>* %p)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
11
22 define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
11
22 define void @bar(<2 x i64>* %p, <2 x i64> %x)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | wc -l | grep 1
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
11
22 define void @bar(<2 x i64>* %p, <2 x i64> %x)
33 {
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 2
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
11
22 define <4 x float> @foo(<4 x float>* %p)
33 {
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep movl | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep movl | count 1
11
22 %dst = global int 0
33 %ptr = global int* null
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {and DWORD PTR} | wc -l | grep 2
1 ; RUN: grep {and DWORD PTR} | count 2
22
33 target endian = little
44 target pointersize = 32
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \
1 ; RUN: grep .hidden | wc -l | grep 2
1 ; RUN: grep .hidden | count 2
22 ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \
3 ; RUN: grep .private_extern | wc -l | grep 2
3 ; RUN: grep .private_extern | count 2
44
55 %struct.Person = type { i32 }
66 @a = hidden global i32 0
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep GOT %t | wc -l | grep 3
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep GOT %t | count 3
55 ; RUN: not grep GOTOFF %t | wc -l
66
77 @ptr = external global i32*
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
11 ; RUN: -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep GOTOFF %t | wc -l | grep 4
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep GOTOFF %t | count 4
55
66 @ptr = internal global i32* null
77 @dst = internal global i32 0
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
11 ; RUN: -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep PLT %t | wc -l | grep 1
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep PLT %t | count 1
55
66 define void @bar() {
77 entry:
0 ; RUN: llvm-as < %s | \
11 ; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep PLT %t | wc -l | grep 1
5 ; RUN: grep GOT %t | wc -l | grep 1
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep PLT %t | count 1
5 ; RUN: grep GOT %t | count 1
66 ; RUN: not grep GOTOFF %t
77
88 @pfoo = external global void(...)*
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
11 ; RUN: -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep PLT %t | wc -l | grep 1
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep PLT %t | count 1
55
66 @ptr = external global i32*
77
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
11 ; RUN: -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep GOT %t | wc -l | grep 3
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep GOT %t | count 3
55
66 @ptr = global i32* null
77 @dst = global i32 0
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
11 ; RUN: -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep GOTOFF %t | wc -l | grep 2
5 ; RUN: grep CPI %t | wc -l | grep 4
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep GOTOFF %t | count 2
5 ; RUN: grep CPI %t | count 4
66
77 define double @foo(i32 %a.u) {
88 entry:
0 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
11 ; RUN: -o %t -f
22 ; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
3 ; RUN: grep piclabel %t | wc -l | grep 3
4 ; RUN: grep PLT %t | wc -l | grep 6
5 ; RUN: grep GOTOFF %t | wc -l | grep 2
6 ; RUN: grep JTI %t | wc -l | grep 9
3 ; RUN: grep piclabel %t | count 3
4 ; RUN: grep PLT %t | count 6
5 ; RUN: grep GOTOFF %t | count 2
6 ; RUN: grep JTI %t | count 9
77
88 define void @bar(i32 %n.u) {
99 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep movss %t | wc -l | grep 3
2 ; RUN: grep movhlps %t | wc -l | grep 1
3 ; RUN: grep pshufd %t | wc -l | grep 1
4 ; RUN: grep unpckhpd %t | wc -l | grep 1
1 ; RUN: grep movss %t | count 3
2 ; RUN: grep movhlps %t | count 1
3 ; RUN: grep pshufd %t | count 1
4 ; RUN: grep unpckhpd %t | count 1
55
66 void %test1(<4 x float>* %F, float* %f) {
77 %tmp = load <4 x float>* %F
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep movss %t | wc -l | grep 1
2 ; RUN: grep pinsrw %t | wc -l | grep 2
1 ; RUN: grep movss %t | count 1
2 ; RUN: grep pinsrw %t | count 2
33
44 void %test(<4 x float>* %F, int %I) {
55 %tmp = load <4 x float>* %F
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
1 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 2
1 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
22 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep andnps
3 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | wc -l | grep 2
3 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | count 2
44
55 define void @t(<4 x float> %A) {
66 %tmp1277 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %A
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | count 1
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | count 1
22
33 <4 x float> %test1(float %a) {
44 %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep shufps %t | wc -l | grep 1
2 ; RUN: grep pshufd %t | wc -l | grep 1
1 ; RUN: grep shufps %t | count 1
2 ; RUN: grep pshufd %t | count 1
33
44 <4 x float> %test(float %a) {
55 %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pinsrw | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 2
11
22 <2 x long> %test(short %a) {
33 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep movlhps %t | wc -l | grep 2
2 ; RUN: grep unpcklps %t | wc -l | grep 1
3 ; RUN: grep punpckldq %t | wc -l | grep 1
1 ; RUN: grep movlhps %t | count 2
2 ; RUN: grep unpcklps %t | count 1
3 ; RUN: grep punpckldq %t | count 1
44
55 <4 x float> %test1(float %a, float %b) {
66 %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep unpcklps %t | wc -l | grep 1
2 ; RUN: grep shufps %t | wc -l | grep 1
1 ; RUN: grep unpcklps %t | count 1
2 ; RUN: grep shufps %t | count 1
33
44 <4 x float> %test(float %a, float %b, float %c) {
55 %tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movq | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movq | count 1
11
22 <2 x long> %test(<2 x long>* %p) {
33 %tmp = cast <2 x long>* %p to double*
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpckl | wc -l | grep 7
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpckl | count 7
11
22 void %test(<8 x short>* %b, short %a0, short %a1, short %a2, short %a3, short %a4, short %a5, short %a6, short %a7) {
33 %tmp = insertelement <8 x short> zeroinitializer, short %a0, uint 0
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
1 ; RUN: grep unpcklps | wc -l | grep 1
1 ; RUN: grep unpcklps | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
3 ; RUN: grep unpckhps | wc -l | grep 1
3 ; RUN: grep unpckhps | count 1
44 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
55 ; RUN: not grep {sub.*esp}
66
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep pshufhw %t | wc -l | grep 1
2 ; RUN: grep pshuflw %t | wc -l | grep 1
3 ; RUN: grep movhps %t | wc -l | grep 1
1 ; RUN: grep pshufhw %t | count 1
2 ; RUN: grep pshuflw %t | count 1
3 ; RUN: grep movhps %t | count 1
44
55 void %test1(<2 x long>* %res, <2 x long>* %A) {
66 %tmp = load <2 x long>* %A
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep movlhps %t | wc -l | grep 1
2 ; RUN: grep movhlps %t | wc -l | grep 1
1 ; RUN: grep movlhps %t | count 1
2 ; RUN: grep movhlps %t | count 1
33
44 <4 x float> %test1(<4 x float>* %x, <4 x float>* %y) {
55 %tmp = load <4 x float>* %y
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 > %t
1 ; RUN: grep shuf %t | wc -l | grep 2
1 ; RUN: grep shuf %t | count 2
22 ; RUN: not grep unpck %t
33 void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B, <4 x float>* %C) {
44 %tmp3 = load <4 x float>* %B
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep movhlps %t | wc -l | grep 1
2 ; RUN: grep shufps %t | wc -l | grep 1
1 ; RUN: grep movhlps %t | count 1
2 ; RUN: grep shufps %t | count 1
33
44 void %test() {
55 %tmp1 = load <4 x float>* null
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep movapd %t | wc -l | grep 1
2 ; RUN: grep movaps %t | wc -l | grep 1
3 ; RUN: grep movups %t | wc -l | grep 2
1 ; RUN: grep movapd %t | count 1
2 ; RUN: grep movaps %t | count 1
3 ; RUN: grep movups %t | count 2
44
55 target triple = "i686-apple-darwin"
66
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep xorps %t | wc -l | grep 1
1 ; RUN: grep xorps %t | count 1
22 ; RUN: not grep shufps %t
33
44 void %test() {
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep punpck %t | wc -l | grep 2
1 ; RUN: grep punpck %t | count 2
22 ; RUN: not grep pextrw %t
33
44 <4 x int> %test(sbyte** %ptr) {
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
1 ; RUN: grep shufp %t | wc -l | grep 1
2 ; RUN: grep movupd %t | wc -l | grep 1
3 ; RUN: grep pshufhw %t | wc -l | grep 1
1 ; RUN: grep shufp %t | count 1
2 ; RUN: grep movupd %t | count 1
3 ; RUN: grep pshufhw %t | count 1
44
55 void %test_v4sf(<4 x float>* %P, float %X, float %Y) {
66 %tmp = insertelement <4 x float> zeroinitializer, float %X, uint 0
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | count 1
11
22 void %test(<2 x long>* %P, sbyte %x) {
33 %tmp = insertelement <16 x sbyte> zeroinitializer, sbyte %x, uint 0 ; <<16 x sbyte>> [#uses=1]
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 -o %t -f
1 ; RUN: grep minss %t | grep CPI | wc -l | grep 2
1 ; RUN: grep minss %t | grep CPI | count 2
22 ; RUN: grep CPI %t | not grep movss
33
44 target endian = little
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
11
22 void %foo(<4 x float> *%P) {
33 %T = load <4 x float> * %P
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -o %t1 -f
1 ; RUN: grep GOTPCREL %t1 | wc -l | grep 4
2 ; RUN: grep rip %t1 | wc -l | grep 6
3 ; RUN: grep movq %t1 | wc -l | grep 6
4 ; RUN: grep leaq %t1 | wc -l | grep 1
1 ; RUN: grep GOTPCREL %t1 | count 4
2 ; RUN: grep rip %t1 | count 6
3 ; RUN: grep movq %t1 | count 6
4 ; RUN: grep leaq %t1 | count 1
55 ; RUN: llvm-upgrade < %s | llvm-as | \
66 ; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=static -o %t2 -f
7 ; RUN: grep rip %t2 | wc -l | grep 4
8 ; RUN: grep movl %t2 | wc -l | grep 2
9 ; RUN: grep movq %t2 | wc -l | grep 2
7 ; RUN: grep rip %t2 | count 4
8 ; RUN: grep movl %t2 | count 2
9 ; RUN: grep movq %t2 | count 2
1010
1111 %ptr = external global int*
1212 %src = external global [0 x int]
1616 %c2 = select bool true, <2 x int> , <2 x int> %t0
1717 store <2 x int> , <2 x int>* %foo
1818 ret void
19 }
19 }
99 %t0 = load <2 x int>* %foo;
1010 store <2 x int> %t0, <2 x int>* %bar
1111 ret void
12 }
12 }
1111 %t2 = select bool true, <4 x float> %t0, <4 x float> %t1
1212 store <4 x float> %t2, <4 x float>* %bar
1313 ret void
14 }
14 }
1111 %t3 = select bool false, <4 x float> %t0, <4 x float> %t2
1212 store <4 x float> %t3, <4 x float>* %bar
1313 ret void
14 }
14 }
None // RUN: tblgen %s | grep {zing = 4} | wc -l | grep 2
0 // RUN: tblgen %s | grep {zing = 4} | count 2
11
22 class C1 {
33 int bar = A;
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | \
1 ; RUN: grep -F {ret i32* null} | wc -l | grep 2
1 ; RUN: grep -F {ret i32* null} | count 2
22
33 int* %test1() {
44 %X = cast float 0.0 to int*
66 block2:
77 %z2 = bitcast i32 0 to i32
88 ret i32 %z2
9 }
9 }
1616 %DEAD = load i32** %p
1717 %c = load i32* %DEAD
1818 ret i32 %c
19 }
19 }
99 %DEADGEP = getelementptr i32* %DEADLOAD, i32 0
1010 %DEADLOAD2 = load i32* %DEADGEP
1111 ret i32 %DEADLOAD2
12 }
12 }
1515 %DEAD = load i32** %p
1616 %c = load i32* %DEAD
1717 ret i32 %c
18 }
18 }
1515 block4:
1616 %DEAD = load i32* %p
1717 ret i32 %DEAD
18 }
18 }
0 ; The i induction variable looks like a wrap-around, but it really is just
11 ; a simple affine IV. Make sure that indvars eliminates it.
22
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep phi | wc -l | grep 1
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep phi | count 1
44
55 void %foo() {
66 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep mul | wc -l | grep 2
1 ; RUN: grep mul | count 2
22
33
44 <4 x float> %test(<4 x float> %V) {
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep icmp | wc -l | grep 1
1 ; RUN: grep icmp | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
3 ; RUN: grep {icmp ugt} | wc -l | grep 1
3 ; RUN: grep {icmp ugt} | count 1
44 ; END.
55
66 ; ModuleID = 'bugpoint-tooptimize.bc'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep and | wc -l | grep 1
1 ; RUN: grep and | count 1
22
33 ; Should be optimized to one and.
44 bool %test1(uint %a, uint %b) {
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 4
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 4
11 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and
22 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep { or}
33
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 2
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 1
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 2
22
33 ; (x&z) ^ (y&z) -> (x^y)&z
44 define i32 @test1(i32 %x, i32 %y, i32 %z) {
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 2
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 2
11
22 ; Should be optimized to one and.
33 define i1 @test1(i33 %a, i33 %b) {
0 ; This test case checks that the merge of and/xor can work on arbitrary
11 ; precision integers.
22
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 2
3 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep and | count 1
4 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep xor | count 2
55
66 ; (x &z ) ^ (y & z) -> (x ^ y) & z
77 define i57 @test1(i57 %x, i57 %y, i57 %z) {
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
1 ; RUN: egrep {shl|lshr|ashr} | wc -l | grep 3
1 ; RUN: egrep {shl|lshr|ashr} | count 3
22
33 define i41 @test0(i41 %A, i41 %B, i41 %C) {
44 %X = shl i41 %A, %C
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep ret | wc -l | grep 3
1 ; RUN: grep ret | count 3
22 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
33 ; RUN: not grep call.*bswap
44
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep {call.*llvm.bswap} | wc -l | grep 5
1 ; RUN: grep {call.*llvm.bswap} | count 5
22 ; END.
33
44 uint %test1(uint %i) {
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 16} | wc -l | grep 12
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 16} | count 12
11
22 @x = external global <2 x i64>, align 16
33 @xx = external global [13 x <2 x i64>], align 16
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
1 ; RUN: egrep {shl|lshr|ashr} | wc -l | grep 3
1 ; RUN: egrep {shl|lshr|ashr} | count 3
22
33 define i32 @test0(i32 %A, i32 %B, i32 %C) {
44 %X = shl i32 %A, %C
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep {lshr i32} | wc -l | grep 2
1 ; RUN: grep {lshr i32} | count 2
22 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep ashr
33
44 int %test1(int %X, ubyte %A) {
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
1 ; RUN: grep {ret i32 %.toremerge} | wc -l | grep 2
1 ; RUN: grep {ret i32 %.toremerge} | count 2
22 ;; Simple sinking tests
33
44 ; "if then else"
11 ; udiv X, (Select Cond, C1, C2) --> Select Cond, (shr X, C1), (shr X, C2)
22 ;
33 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis -f -o %t
4 ; RUN: grep select %t | wc -l | grep 1
5 ; RUN: grep lshr %t | wc -l | grep 2
6 ; RUN: ignore grep udiv %t | wc -l | grep 0
4 ; RUN: grep select %t | count 1
5 ; RUN: grep lshr %t | count 2
6 ; RUN: ignore grep udiv %t | count 0
77
88 define i64 @test(i64 %X, i1 %Cond ) {
99 entry:
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
1 ; RUN: grep shufflevec | wc -l | grep 1
1 ; RUN: grep shufflevec | count 1
22 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
33 ; RUN: not grep insertelement
44 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
None ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {zext } | wc -l | grep 1
0 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {zext } | count 1
11 ; PR1570
22 ; XFAIL: *
33
0 ; Loop Simplify should turn phi nodes like X = phi [X, Y] into just Y, eliminating them.
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify | llvm-dis | grep phi | wc -l | grep 6
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loopsimplify | llvm-dis | grep phi | count 6
22
33 %A = weak global [3000000 x int] zeroinitializer ; <[3000000 x int]*> [#uses=1]
44 %B = weak global [20000 x int] zeroinitializer ; <[20000 x int]*> [#uses=1]
0 ; Check that this test makes INDVAR and related stuff dead.
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | wc -l | grep 2
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | count 2
22
33 declare bool %pred()
44
None ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | count 1
11
22 ; This should only result in one PHI node!
33
None ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep mul | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep mul | count 1
11 ; LSR should not make two copies of the Q*L expression in the preheader!
22
33 sbyte %test(sbyte* %A, sbyte* %B, int %L, int %Q, int %N.s) {
None ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep phi | count 1
11
22 ; This testcase should have ONE stride 18 indvar, the other use should have a
33 ; loop invariant value (B) added to it inside of the loop, instead of having
6262
6363 normal_char: ; preds = %bb147
6464 ret i32 0
65 }
65 }
0 ; RUN: llvm-as %s -o - | opt -lowerswitch | llvm-dis > %t
1 ; RUN: grep slt %t | wc -l | grep 10
2 ; RUN: grep ule %t | wc -l | grep 3
3 ; RUN: grep eq %t | wc -l | grep 9
1 ; RUN: grep slt %t | count 10
2 ; RUN: grep ule %t | count 3
3 ; RUN: grep eq %t | count 9
44
55 define i32 @main(i32 %tmp158) {
66 entry:
None ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -gcse | llvm-dis | grep add | wc -l | grep 6
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -gcse | llvm-dis | grep add | count 6
11 ; Each of these functions should turn into two adds each.
22
33 %e = external global int
11
22 ; RUN: llvm-upgrade < %s | llvm-as | \
33 ; RUN: opt -reassociate -instcombine | llvm-dis > %t
4 ; RUN: grep mul %t | wc -l | grep 2
5 ; RUN: grep add %t | wc -l | grep 1
4 ; RUN: grep mul %t | count 2
5 ; RUN: grep add %t | count 1
66
77 int %test(int %A, int %B, int %C) {
88 %aa = mul int %A, %A
None ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -instcombine | llvm-dis | grep mul | count 2
11
22 ; This should have exactly 2 multiplies when we're done.
33
11
22 ; RUN: llvm-upgrade < %s | llvm-as | \
33 ; RUN: opt -instcombine -reassociate -instcombine | llvm-dis -o %t
4 ; RUN: grep mul %t | wc -l | grep 1
5 ; RUN: grep add %t | wc -l | grep 1
4 ; RUN: grep mul %t | count 1
5 ; RUN: grep add %t | count 1
66
77 int %main(int %t) {
88 %tmp.3 = mul int %t, 12 ; [#uses=1]
0 ; There should be exactly one shift and one add left.
11 ; RUN: llvm-upgrade < %s | llvm-as | \
22 ; RUN: opt -reassociate -instcombine | llvm-dis > %t
3 ; RUN: grep shl %t | wc -l | grep 1
4 ; RUN: grep add %t | wc -l | grep 1
3 ; RUN: grep shl %t | count 1
4 ; RUN: grep add %t | count 1
55
66 int %test(int %X, int %Y) {
77 %tmp.2 = shl int %X, ubyte 1 ; [#uses=1]
None ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | grep {br i1} | wc -l | grep 1
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | grep {br i1} | count 1
11
22 void %test(int* %P, int* %Q, bool %A, bool %B) {
33 br bool %A, label %a, label %b ;; fold the two branches into one
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg | llvm-dis | \
1 ; RUN: grep switch | wc -l | grep 1
1 ; RUN: grep switch | count 1
22
33 ; Test that a switch going to a switch on the same value can be merged. All
44 ; three switches in this example can be merged into one big one.