summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-08-15 13:36:28 +0000
committerDan Gohman <gohman@apple.com>2007-08-15 13:36:28 +0000
commit28beeeac4db2d582d4947db96d62e423e4b68d88 (patch)
tree3a500b846e77d285021ec12e3ef0bbe69c498b82 /test/CodeGen/X86
parent7375bb9c8c82115dd401d67f0baaf30d6c481bd0 (diff)
downloadllvm-28beeeac4db2d582d4947db96d62e423e4b68d88.tar.gz
llvm-28beeeac4db2d582d4947db96d62e423e4b68d88.tar.bz2
llvm-28beeeac4db2d582d4947db96d62e423e4b68d88.tar.xz
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
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll2
-rw-r--r--test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll4
-rw-r--r--test/CodeGen/X86/2006-11-28-Memcpy.ll4
-rw-r--r--test/CodeGen/X86/2007-01-08-InstrSched.ll2
-rw-r--r--test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll2
-rw-r--r--test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll4
-rw-r--r--test/CodeGen/X86/2007-06-14-branchfold.ll2
-rw-r--r--test/CodeGen/X86/2007-08-10-LEA16Use32.ll2
-rw-r--r--test/CodeGen/X86/2007-08-10-SignExtSubreg.ll2
-rw-r--r--test/CodeGen/X86/2007-08-13-SpillerReuse.ll2
-rw-r--r--test/CodeGen/X86/and-or-fold.ll2
-rw-r--r--test/CodeGen/X86/bitcast2.ll2
-rw-r--r--test/CodeGen/X86/bswap.ll4
-rw-r--r--test/CodeGen/X86/call-push.ll2
-rw-r--r--test/CodeGen/X86/cmp-test.ll4
-rw-r--r--test/CodeGen/X86/commute-two-addr.ll2
-rw-r--r--test/CodeGen/X86/compare_folding.llx2
-rw-r--r--test/CodeGen/X86/dollar-name.ll6
-rw-r--r--test/CodeGen/X86/extend.ll4
-rw-r--r--test/CodeGen/X86/extern_weak.ll2
-rw-r--r--test/CodeGen/X86/fabs.ll4
-rw-r--r--test/CodeGen/X86/fildll.ll2
-rw-r--r--test/CodeGen/X86/fp-stack-ret.ll4
-rw-r--r--test/CodeGen/X86/fsxor-alignment.ll2
-rw-r--r--test/CodeGen/X86/lea-recursion.ll2
-rw-r--r--test/CodeGen/X86/long-setcc.ll6
-rw-r--r--test/CodeGen/X86/loop-strength-reduce.ll2
-rw-r--r--test/CodeGen/X86/mingw-alloca.ll4
-rw-r--r--test/CodeGen/X86/mmx-insert-element.ll2
-rw-r--r--test/CodeGen/X86/mmx-punpckhdq.ll2
-rw-r--r--test/CodeGen/X86/peep-vector-extract-insert.ll2
-rw-r--r--test/CodeGen/X86/pr1489.ll4
-rw-r--r--test/CodeGen/X86/pr1505b.ll4
-rw-r--r--test/CodeGen/X86/rotate.ll2
-rw-r--r--test/CodeGen/X86/scalar-min-max-fill-operand.ll6
-rw-r--r--test/CodeGen/X86/scalar_sse_minmax.ll4
-rw-r--r--test/CodeGen/X86/shift-codegen.ll2
-rw-r--r--test/CodeGen/X86/shift-double.llx2
-rw-r--r--test/CodeGen/X86/shift-folding.ll2
-rw-r--r--test/CodeGen/X86/sse-align-1.ll2
-rw-r--r--test/CodeGen/X86/sse-align-10.ll2
-rw-r--r--test/CodeGen/X86/sse-align-12.ll10
-rw-r--r--test/CodeGen/X86/sse-align-2.ll2
-rw-r--r--test/CodeGen/X86/sse-align-3.ll2
-rw-r--r--test/CodeGen/X86/sse-align-4.ll2
-rw-r--r--test/CodeGen/X86/sse-align-5.ll2
-rw-r--r--test/CodeGen/X86/sse-align-6.ll2
-rw-r--r--test/CodeGen/X86/sse-align-7.ll2
-rw-r--r--test/CodeGen/X86/sse-align-8.ll2
-rw-r--r--test/CodeGen/X86/sse-align-9.ll2
-rw-r--r--test/CodeGen/X86/store-global-address.ll2
-rw-r--r--test/CodeGen/X86/store_op_load_fold2.ll2
-rw-r--r--test/CodeGen/X86/test-hidden.ll4
-rw-r--r--test/CodeGen/X86/test-pic-1.ll4
-rw-r--r--test/CodeGen/X86/test-pic-2.ll4
-rw-r--r--test/CodeGen/X86/test-pic-3.ll4
-rw-r--r--test/CodeGen/X86/test-pic-4.ll6
-rw-r--r--test/CodeGen/X86/test-pic-5.ll4
-rw-r--r--test/CodeGen/X86/test-pic-6.ll4
-rw-r--r--test/CodeGen/X86/test-pic-cpool.ll6
-rw-r--r--test/CodeGen/X86/test-pic-jtbl.ll8
-rw-r--r--test/CodeGen/X86/vec_extract.ll8
-rw-r--r--test/CodeGen/X86/vec_insert.ll4
-rw-r--r--test/CodeGen/X86/vec_logical.ll4
-rw-r--r--test/CodeGen/X86/vec_set-2.ll4
-rw-r--r--test/CodeGen/X86/vec_set-3.ll4
-rw-r--r--test/CodeGen/X86/vec_set-4.ll2
-rw-r--r--test/CodeGen/X86/vec_set-5.ll6
-rw-r--r--test/CodeGen/X86/vec_set-6.ll4
-rw-r--r--test/CodeGen/X86/vec_set-7.ll2
-rw-r--r--test/CodeGen/X86/vec_set.ll2
-rw-r--r--test/CodeGen/X86/vec_shuffle-10.ll4
-rw-r--r--test/CodeGen/X86/vec_shuffle-2.ll6
-rw-r--r--test/CodeGen/X86/vec_shuffle-3.ll4
-rw-r--r--test/CodeGen/X86/vec_shuffle-4.ll2
-rw-r--r--test/CodeGen/X86/vec_shuffle-5.ll4
-rw-r--r--test/CodeGen/X86/vec_shuffle-6.ll6
-rw-r--r--test/CodeGen/X86/vec_shuffle-7.ll2
-rw-r--r--test/CodeGen/X86/vec_shuffle-9.ll2
-rw-r--r--test/CodeGen/X86/vec_shuffle.ll6
-rw-r--r--test/CodeGen/X86/vec_splat-2.ll2
-rw-r--r--test/CodeGen/X86/vec_ss_load_fold.ll2
-rw-r--r--test/CodeGen/X86/vec_zero.ll2
-rw-r--r--test/CodeGen/X86/x86-64-mem.ll14
84 files changed, 144 insertions, 144 deletions
diff --git a/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll b/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
index 02180cbf24..aa141d20cf 100644
--- a/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
+++ b/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
-; RUN: grep shld | wc -l | grep 1
+; RUN: grep shld | count 1
;
; Check that the isel does not fold the shld, which already folds a load
; and has two uses, into a store.
diff --git a/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll b/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
index a3d961a5b1..03e7f7bd9c 100644
--- a/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
+++ b/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
@@ -1,9 +1,9 @@
; RUN: llvm-upgrade < %s | llvm-as | \
; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
-; RUN: grep {movl _last} | wc -l | grep 1
+; RUN: grep {movl _last} | count 1
; RUN: llvm-upgrade < %s | llvm-as | \
; RUN: llc -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static | \
-; RUN: grep {cmpl.*_last} | wc -l | grep 1
+; RUN: grep {cmpl.*_last} | count 1
%block = external global ubyte* ; <ubyte**> [#uses=1]
%last = external global int ; <int*> [#uses=3]
diff --git a/test/CodeGen/X86/2006-11-28-Memcpy.ll b/test/CodeGen/X86/2006-11-28-Memcpy.ll
index cbce0ef503..196dd4528c 100644
--- a/test/CodeGen/X86/2006-11-28-Memcpy.ll
+++ b/test/CodeGen/X86/2006-11-28-Memcpy.ll
@@ -1,8 +1,8 @@
; PR1022, PR1023
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
-; RUN: grep 3721182122 | wc -l | grep 2
+; RUN: grep 3721182122 | count 2
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
-; RUN: grep -E {movl _?bytes2} | wc -l | grep 1
+; RUN: grep -E {movl _?bytes2} | count 1
%fmt = constant [4 x sbyte] c"%x\0A\00"
%bytes = constant [4 x sbyte] c"\AA\BB\CC\DD"
diff --git a/test/CodeGen/X86/2007-01-08-InstrSched.ll b/test/CodeGen/X86/2007-01-08-InstrSched.ll
index bcc0d6313e..811e9ac6d1 100644
--- a/test/CodeGen/X86/2007-01-08-InstrSched.ll
+++ b/test/CodeGen/X86/2007-01-08-InstrSched.ll
@@ -1,6 +1,6 @@
; PR1075
; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | \
-; RUN: %prcontext {mulss LCPI1_3} 1 | grep mulss | wc -l | grep 1
+; RUN: %prcontext {mulss LCPI1_3} 1 | grep mulss | count 1
define float @foo(float %x) {
%tmp1 = mul float %x, 3.000000e+00
diff --git a/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll b/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll
index 4083a24fa8..4c69ec733d 100644
--- a/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll
+++ b/test/CodeGen/X86/2007-03-15-GEP-Idx-Sink.ll
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-darwin | \
-; RUN: grep push | wc -l | grep 3
+; RUN: grep push | count 3
define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) {
entry:
diff --git a/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll b/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll
index 0d2082421b..7ea9fbd2cd 100644
--- a/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll
+++ b/test/CodeGen/X86/2007-04-25-MMX-PADDQ.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep paddq | wc -l | grep 2
-; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep movq | wc -l | grep 3
+; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep paddq | count 2
+; RUN: llvm-as < %s | llc -o - -march=x86 -mattr=+mmx | grep movq | count 3
define <1 x i64> @unsigned_add3(<1 x i64>* %a, <1 x i64>* %b, i32 %count) {
entry:
diff --git a/test/CodeGen/X86/2007-06-14-branchfold.ll b/test/CodeGen/X86/2007-06-14-branchfold.ll
index a7194a08ff..b78c63d4a3 100644
--- a/test/CodeGen/X86/2007-06-14-branchfold.ll
+++ b/test/CodeGen/X86/2007-06-14-branchfold.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -mcpu=i686 | grep jmp | wc -l | grep 1
+; RUN: llvm-as < %s | llc -mcpu=i686 | grep jmp | count 1
; check that branch folding understands FP_REG_KILL is not a branch
; the remaining jmp can be removed if we take advantage of knowing
; abort does not return
diff --git a/test/CodeGen/X86/2007-08-10-LEA16Use32.ll b/test/CodeGen/X86/2007-08-10-LEA16Use32.ll
index 5bb696f1ea..f6a848255f 100644
--- a/test/CodeGen/X86/2007-08-10-LEA16Use32.ll
+++ b/test/CodeGen/X86/2007-08-10-LEA16Use32.ll
@@ -20,4 +20,4 @@ bb: ; preds = %bb, %entry
return: ; preds = %bb, %entry
ret void
-} \ No newline at end of file
+}
diff --git a/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll b/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
index bb75c4776f..b62d2c61bb 100644
--- a/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
+++ b/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
@@ -7,4 +7,4 @@ entry:
store i32 %x, i32* @X, align 4
%retval67 = trunc i32 %x to i8 ; <i8> [#uses=1]
ret i8 %retval67
-} \ No newline at end of file
+}
diff --git a/test/CodeGen/X86/2007-08-13-SpillerReuse.ll b/test/CodeGen/X86/2007-08-13-SpillerReuse.ll
index fe87046d71..8cc235ba6c 100644
--- a/test/CodeGen/X86/2007-08-13-SpillerReuse.ll
+++ b/test/CodeGen/X86/2007-08-13-SpillerReuse.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | wc -l | grep 5
+; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin | grep "48(%esp)" | count 5
%struct..0anon = type { i32 }
%struct.rtvec_def = type { i32, [1 x %struct..0anon] }
diff --git a/test/CodeGen/X86/and-or-fold.ll b/test/CodeGen/X86/and-or-fold.ll
index 3240bdf25a..a321710092 100644
--- a/test/CodeGen/X86/and-or-fold.ll
+++ b/test/CodeGen/X86/and-or-fold.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep and | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep and | count 1
; The dag combiner should fold together (x&127)|(y&16711680) -> (x|y)&c1
; in this case.
diff --git a/test/CodeGen/X86/bitcast2.ll b/test/CodeGen/X86/bitcast2.ll
index edf85238a3..3e26931578 100644
--- a/test/CodeGen/X86/bitcast2.ll
+++ b/test/CodeGen/X86/bitcast2.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 2
; RUN: llvm-as < %s | llc -march=x86-64 | not grep rsp
define i64 @test1(double %A) {
diff --git a/test/CodeGen/X86/bswap.ll b/test/CodeGen/X86/bswap.ll
index 4749ea8f54..ab60977115 100644
--- a/test/CodeGen/X86/bswap.ll
+++ b/test/CodeGen/X86/bswap.ll
@@ -1,8 +1,8 @@
; bswap should be constant folded when it is passed a constant argument
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
-; RUN: grep bswapl | wc -l | grep 3
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rolw | wc -l | grep 1
+; RUN: grep bswapl | count 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep rolw | count 1
declare ushort %llvm.bswap.i16(ushort)
declare uint %llvm.bswap.i32(uint)
diff --git a/test/CodeGen/X86/call-push.ll b/test/CodeGen/X86/call-push.ll
index d2d33f682a..ad9b796a85 100644
--- a/test/CodeGen/X86/call-push.ll
+++ b/test/CodeGen/X86/call-push.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -disable-fp-elim | grep subl | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -disable-fp-elim | grep subl | count 1
%struct.decode_t = type { i8, i8, i8, i8, i16, i8, i8, %struct.range_t** }
%struct.range_t = type { float, float, i32, i32, i32, [0 x i8] }
diff --git a/test/CodeGen/X86/cmp-test.ll b/test/CodeGen/X86/cmp-test.ll
index 78d8d8f3d8..2792b57bd7 100644
--- a/test/CodeGen/X86/cmp-test.ll
+++ b/test/CodeGen/X86/cmp-test.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | wc -l | grep 1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep test | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep cmp | count 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep test | count 1
int %f1(int %X, int* %y) {
%tmp = load int* %y
diff --git a/test/CodeGen/X86/commute-two-addr.ll b/test/CodeGen/X86/commute-two-addr.ll
index c181354784..32eef1a435 100644
--- a/test/CodeGen/X86/commute-two-addr.ll
+++ b/test/CodeGen/X86/commute-two-addr.ll
@@ -3,7 +3,7 @@
; Make sure there are only 3 mov's for each testcase
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {\\\<mov\\\>} | wc -l | grep 6
+; RUN: grep {\\\<mov\\\>} | count 6
target triple = "i686-pc-linux-gnu"
diff --git a/test/CodeGen/X86/compare_folding.llx b/test/CodeGen/X86/compare_folding.llx
index 631bc92312..e138688b11 100644
--- a/test/CodeGen/X86/compare_folding.llx
+++ b/test/CodeGen/X86/compare_folding.llx
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \
-; RUN: grep movsd | wc -l | grep 1
+; RUN: grep movsd | count 1
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mcpu=yonah | \
; RUN: grep ucomisd
declare bool %llvm.isunordered.f64(double,double)
diff --git a/test/CodeGen/X86/dollar-name.ll b/test/CodeGen/X86/dollar-name.ll
index 87c7315af8..0573056f5e 100644
--- a/test/CodeGen/X86/dollar-name.ll
+++ b/test/CodeGen/X86/dollar-name.ll
@@ -1,6 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$bar) | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$qux) | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$hen) | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$bar) | count 1
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$qux) | count 1
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=att | grep (\$hen) | count 1
; PR1339
@"$bar" = global i32 zeroinitializer
diff --git a/test/CodeGen/X86/extend.ll b/test/CodeGen/X86/extend.ll
index fdad790764..a9e6ba2c27 100644
--- a/test/CodeGen/X86/extend.ll
+++ b/test/CodeGen/X86/extend.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movzx | wc -l | grep 1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movsx | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movzx | count 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep movsx | count 1
%G1 = internal global ubyte 0 ; <ubyte*> [#uses=1]
%G2 = internal global sbyte 0 ; <sbyte*> [#uses=1]
diff --git a/test/CodeGen/X86/extern_weak.ll b/test/CodeGen/X86/extern_weak.ll
index 853a713310..df05b97a3b 100644
--- a/test/CodeGen/X86/extern_weak.ll
+++ b/test/CodeGen/X86/extern_weak.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=i686-apple-darwin | grep weak_reference | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=i686-apple-darwin | grep weak_reference | count 2
%Y = global int (sbyte*)* %X
declare extern_weak int %X(sbyte*)
diff --git a/test/CodeGen/X86/fabs.ll b/test/CodeGen/X86/fabs.ll
index dd94613e7c..4b588620f9 100644
--- a/test/CodeGen/X86/fabs.ll
+++ b/test/CodeGen/X86/fabs.ll
@@ -1,9 +1,9 @@
; Make sure this testcase codegens to the fabs instruction, not a call to fabsf
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=-sse2,-sse3 | \
-; RUN: grep fabs\$ | wc -l | grep 1
+; RUN: grep fabs\$ | count 1
; RUN: llvm-upgrade < %s | llvm-as | \
; RUN: llc -march=x86 -mattr=-sse2,-sse3 -enable-unsafe-fp-math | \
-; RUN: grep fabs\$ | wc -l | grep 2
+; RUN: grep fabs\$ | count 2
target endian = little
target pointersize = 32
diff --git a/test/CodeGen/X86/fildll.ll b/test/CodeGen/X86/fildll.ll
index 711eedeaac..49bbc70d10 100644
--- a/test/CodeGen/X86/fildll.ll
+++ b/test/CodeGen/X86/fildll.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att -mattr=-sse2 | grep fildll | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=att -mattr=-sse2 | grep fildll | count 2
fastcc double %sint64_to_fp(long %X) {
%R = cast long %X to double
diff --git a/test/CodeGen/X86/fp-stack-ret.ll b/test/CodeGen/X86/fp-stack-ret.ll
index 69c5fc58e8..3e6ad54e73 100644
--- a/test/CodeGen/X86/fp-stack-ret.ll
+++ b/test/CodeGen/X86/fp-stack-ret.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | \
; RUN: llc -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 > %t
-; RUN: grep fldl %t | wc -l | grep 1
+; RUN: grep fldl %t | count 1
; RUN: not grep xmm %t
-; RUN: grep {sub.*esp} %t | wc -l | grep 1
+; RUN: grep {sub.*esp} %t | count 1
; These testcases shouldn't require loading into an XMM register then storing
; to memory, then reloading into an FPStack reg.
diff --git a/test/CodeGen/X86/fsxor-alignment.ll b/test/CodeGen/X86/fsxor-alignment.ll
index 0e834d6db1..71007dcc05 100644
--- a/test/CodeGen/X86/fsxor-alignment.ll
+++ b/test/CodeGen/X86/fsxor-alignment.ll
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -enable-unsafe-fp-math | \
-; RUN: grep -v sp | grep xorps | wc -l | grep 2
+; RUN: grep -v sp | grep xorps | count 2
; Don't fold the incoming stack arguments into the xorps instructions used
; to do floating-point negations, because the arguments aren't vectors
diff --git a/test/CodeGen/X86/lea-recursion.ll b/test/CodeGen/X86/lea-recursion.ll
index ca7b3674d2..390e35adfa 100644
--- a/test/CodeGen/X86/lea-recursion.ll
+++ b/test/CodeGen/X86/lea-recursion.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | wc -l | grep 12
+; RUN: llvm-as < %s | llc -march=x86-64 | grep lea | count 12
; This testcase was written to demonstrate an instruction-selection problem,
; however it also happens to expose a limitation in the DAGCombiner's
diff --git a/test/CodeGen/X86/long-setcc.ll b/test/CodeGen/X86/long-setcc.ll
index 6097d96850..55e7c86891 100644
--- a/test/CodeGen/X86/long-setcc.ll
+++ b/test/CodeGen/X86/long-setcc.ll
@@ -1,6 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=x86 | grep xor | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 1
+; RUN: llvm-as < %s | llc -march=x86 | grep shr | count 1
+; RUN: llvm-as < %s | llc -march=x86 | grep xor | count 1
define i1 @t1(i64 %x) {
%B = icmp slt i64 %x, 0
diff --git a/test/CodeGen/X86/loop-strength-reduce.ll b/test/CodeGen/X86/loop-strength-reduce.ll
index eb1eee8019..37ced6075b 100644
--- a/test/CodeGen/X86/loop-strength-reduce.ll
+++ b/test/CodeGen/X86/loop-strength-reduce.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
-; RUN: grep {A(} | wc -l | grep 1
+; RUN: grep {A(} | count 1
;
; Make sure the common loop invariant _A(reg) is hoisted up to preheader.
diff --git a/test/CodeGen/X86/mingw-alloca.ll b/test/CodeGen/X86/mingw-alloca.ll
index 40fc80a3e7..c0a2f3d734 100644
--- a/test/CodeGen/X86/mingw-alloca.ll
+++ b/test/CodeGen/X86/mingw-alloca.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -o %t -f
-; RUN: grep __alloca %t | wc -l | grep 2
+; RUN: grep __alloca %t | count 2
; RUN: grep 8028 %t
; RUN: grep {pushl %eax} %t
-; RUN: grep 8024 %t | wc -l | grep 2
+; RUN: grep 8024 %t | count 2
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"
target triple = "i386-mingw32"
diff --git a/test/CodeGen/X86/mmx-insert-element.ll b/test/CodeGen/X86/mmx-insert-element.ll
index 3f2e4020d7..e24b4821b9 100644
--- a/test/CodeGen/X86/mmx-insert-element.ll
+++ b/test/CodeGen/X86/mmx-insert-element.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep movq | wc -l | grep 3
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep movq | count 3
; FIXME: This code outputs:
;
diff --git a/test/CodeGen/X86/mmx-punpckhdq.ll b/test/CodeGen/X86/mmx-punpckhdq.ll
index 57c73c7625..126fc9d13b 100644
--- a/test/CodeGen/X86/mmx-punpckhdq.ll
+++ b/test/CodeGen/X86/mmx-punpckhdq.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep punpckhdq | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx | grep punpckhdq | count 1
define void @bork(<1 x i64>* %x) {
entry:
diff --git a/test/CodeGen/X86/peep-vector-extract-insert.ll b/test/CodeGen/X86/peep-vector-extract-insert.ll
index 2b05af4663..764a8c4c3b 100644
--- a/test/CodeGen/X86/peep-vector-extract-insert.ll
+++ b/test/CodeGen/X86/peep-vector-extract-insert.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep {pxor %xmm0, %xmm0} | count 2
define float @foo(<4 x float> %a) {
%b = insertelement <4 x float> %a, float 0.0, i32 3
diff --git a/test/CodeGen/X86/pr1489.ll b/test/CodeGen/X86/pr1489.ll
index 61e68dfb9f..a7f3e795c6 100644
--- a/test/CodeGen/X86/pr1489.ll
+++ b/test/CodeGen/X86/pr1489.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 1082126238 | wc -l | grep 3
-; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 3058016715 | wc -l | grep 1
+; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 1082126238 | count 3
+; RUN: llvm-as < %s | llc -disable-fp-elim -fast -mcpu=i486 | grep 3058016715 | count 1
;; magic constants are 3.999f and half of 3.999
; ModuleID = '1489.c'
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"
diff --git a/test/CodeGen/X86/pr1505b.ll b/test/CodeGen/X86/pr1505b.ll
index 1e6b7933cd..db1f1ce181 100644
--- a/test/CodeGen/X86/pr1505b.ll
+++ b/test/CodeGen/X86/pr1505b.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | wc -l | grep 4
-; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | wc -l | grep 3
+; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstpl | count 4
+; RUN: llvm-as < %s | llc -mcpu=i486 | grep fstps | count 3
; ModuleID = '<stdin>'
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"
diff --git a/test/CodeGen/X86/rotate.ll b/test/CodeGen/X86/rotate.ll
index fb04be96d6..d0ba29cbf6 100644
--- a/test/CodeGen/X86/rotate.ll
+++ b/test/CodeGen/X86/rotate.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {ro\[rl\]} | wc -l | grep 12
+; RUN: grep {ro\[rl\]} | count 12
uint %rotl32(uint %A, ubyte %Amt) {
%B = shl uint %A, ubyte %Amt
diff --git a/test/CodeGen/X86/scalar-min-max-fill-operand.ll b/test/CodeGen/X86/scalar-min-max-fill-operand.ll
index 9d6fc4ff3c..6a6283a10d 100644
--- a/test/CodeGen/X86/scalar-min-max-fill-operand.ll
+++ b/test/CodeGen/X86/scalar-min-max-fill-operand.ll
@@ -1,6 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep min | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=x86-64 | grep max | wc -l | grep 1
-; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep min | count 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep max | count 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep mov | count 2
declare float @bar()
diff --git a/test/CodeGen/X86/scalar_sse_minmax.ll b/test/CodeGen/X86/scalar_sse_minmax.ll
index 61894a4a20..c462121d9c 100644
--- a/test/CodeGen/X86/scalar_sse_minmax.ll
+++ b/test/CodeGen/X86/scalar_sse_minmax.ll
@@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \
-; RUN: grep mins | wc -l | grep 3
+; RUN: grep mins | count 3
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse1,+sse2 | \
-; RUN: grep maxs | wc -l | grep 2
+; RUN: grep maxs | count 2
declare bool %llvm.isunordered.f64( double %x, double %y )
declare bool %llvm.isunordered.f32( float %x, float %y )
diff --git a/test/CodeGen/X86/shift-codegen.ll b/test/CodeGen/X86/shift-codegen.ll
index 0b40d942d0..deb4ed1f30 100644
--- a/test/CodeGen/X86/shift-codegen.ll
+++ b/test/CodeGen/X86/shift-codegen.ll
@@ -1,5 +1,5 @@
; RUN: llvm-as < %s | llc -relocation-model=static -march=x86 | \
-; RUN: grep {shll \$3} | wc -l | grep 2
+; RUN: grep {shll \$3} | count 2
; This should produce two shll instructions, not any lea's.
diff --git a/test/CodeGen/X86/shift-double.llx b/test/CodeGen/X86/shift-double.llx
index 760e490dd9..46cff2d287 100644
--- a/test/CodeGen/X86/shift-double.llx
+++ b/test/CodeGen/X86/shift-double.llx
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {sh\[lr\]d} | wc -l | grep 5
+; RUN: grep {sh\[lr\]d} | count 5
long %test1(long %X, ubyte %C) {
%Y = shl long %X, ubyte %C
diff --git a/test/CodeGen/X86/shift-folding.ll b/test/CodeGen/X86/shift-folding.ll
index 671476a208..19bf4ee648 100644
--- a/test/CodeGen/X86/shift-folding.ll
+++ b/test/CodeGen/X86/shift-folding.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | \
-; RUN: grep {s\[ah\]\[rl\]l} | wc -l | grep 1
+; RUN: grep {s\[ah\]\[rl\]l} | count 1
int* %test1(int *%P, uint %X) {
%Y = shr uint %X, ubyte 2
diff --git a/test/CodeGen/X86/sse-align-1.ll b/test/CodeGen/X86/sse-align-1.ll
index 1841535841..7135d7a224 100644
--- a/test/CodeGen/X86/sse-align-1.ll
+++ b/test/CodeGen/X86/sse-align-1.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
define <4 x float> @foo(<4 x float>* %p)
{
diff --git a/test/CodeGen/X86/sse-align-10.ll b/test/CodeGen/X86/sse-align-10.ll
index 6f2ffc495f..3738becde7 100644
--- a/test/CodeGen/X86/sse-align-10.ll
+++ b/test/CodeGen/X86/sse-align-10.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
define <2 x i64> @bar(<2 x i64>* %p)
{
diff --git a/test/CodeGen/X86/sse-align-12.ll b/test/CodeGen/X86/sse-align-12.ll
index 731d429608..960a4f6450 100644
--- a/test/CodeGen/X86/sse-align-12.ll
+++ b/test/CodeGen/X86/sse-align-12.ll
@@ -1,8 +1,8 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep unpck | wc -l | grep 2
-; RUN: llvm-as < %s | llc -march=x86-64 | grep shuf | wc -l | grep 2
-; RUN: llvm-as < %s | llc -march=x86-64 | grep ps | wc -l | grep 4
-; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | wc -l | grep 4
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 4
+; RUN: llvm-as < %s | llc -march=x86-64 | grep unpck | count 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep shuf | count 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep ps | count 4
+; RUN: llvm-as < %s | llc -march=x86-64 | grep pd | count 4
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 4
define <4 x float> @a(<4 x float>* %y)
{
diff --git a/test/CodeGen/X86/sse-align-2.ll b/test/CodeGen/X86/sse-align-2.ll
index b5c06748aa..71587a2f68 100644
--- a/test/CodeGen/X86/sse-align-2.ll
+++ b/test/CodeGen/X86/sse-align-2.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
define <4 x float> @foo(<4 x float>* %p, <4 x float> %x)
{
diff --git a/test/CodeGen/X86/sse-align-3.ll b/test/CodeGen/X86/sse-align-3.ll
index 6f96bba69e..ae9faabea4 100644
--- a/test/CodeGen/X86/sse-align-3.ll
+++ b/test/CodeGen/X86/sse-align-3.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movap | count 2
define void @foo(<4 x float>* %p, <4 x float> %x)
{
diff --git a/test/CodeGen/X86/sse-align-4.ll b/test/CodeGen/X86/sse-align-4.ll
index 4bf83b38bc..c98aff76d6 100644
--- a/test/CodeGen/X86/sse-align-4.ll
+++ b/test/CodeGen/X86/sse-align-4.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
define void @foo(<4 x float>* %p, <4 x float> %x)
{
diff --git a/test/CodeGen/X86/sse-align-5.ll b/test/CodeGen/X86/sse-align-5.ll
index de08d13369..a5c4b0dadc 100644
--- a/test/CodeGen/X86/sse-align-5.ll
+++ b/test/CodeGen/X86/sse-align-5.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
define <2 x i64> @bar(<2 x i64>* %p)
{
diff --git a/test/CodeGen/X86/sse-align-6.ll b/test/CodeGen/X86/sse-align-6.ll
index 90729684cb..dc9d99c627 100644
--- a/test/CodeGen/X86/sse-align-6.ll
+++ b/test/CodeGen/X86/sse-align-6.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
define <2 x i64> @bar(<2 x i64>* %p, <2 x i64> %x)
{
diff --git a/test/CodeGen/X86/sse-align-7.ll b/test/CodeGen/X86/sse-align-7.ll
index d1762e0e2d..d93ca40577 100644
--- a/test/CodeGen/X86/sse-align-7.ll
+++ b/test/CodeGen/X86/sse-align-7.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movaps | count 1
define void @bar(<2 x i64>* %p, <2 x i64> %x)
{
diff --git a/test/CodeGen/X86/sse-align-8.ll b/test/CodeGen/X86/sse-align-8.ll
index f9d18145e9..4353698dcc 100644
--- a/test/CodeGen/X86/sse-align-8.ll
+++ b/test/CodeGen/X86/sse-align-8.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | wc -l | grep 1
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movups | count 1
define void @bar(<2 x i64>* %p, <2 x i64> %x)
{
diff --git a/test/CodeGen/X86/sse-align-9.ll b/test/CodeGen/X86/sse-align-9.ll
index fb4fe92161..58641b38b6 100644
--- a/test/CodeGen/X86/sse-align-9.ll
+++ b/test/CodeGen/X86/sse-align-9.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86-64 | grep movup | count 2
define <4 x float> @foo(<4 x float>* %p)
{
diff --git a/test/CodeGen/X86/store-global-address.ll b/test/CodeGen/X86/store-global-address.ll
index 77e344d959..00ae2c9404 100644
--- a/test/CodeGen/X86/store-global-address.ll
+++ b/test/CodeGen/X86/store-global-address.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep movl | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep movl | count 1
%dst = global int 0
%ptr = global int* null
diff --git a/test/CodeGen/X86/store_op_load_fold2.ll b/test/CodeGen/X86/store_op_load_fold2.ll
index 82ff4dbd32..a7d719ee2e 100644
--- a/test/CodeGen/X86/store_op_load_fold2.ll
+++ b/test/CodeGen/X86/store_op_load_fold2.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {and DWORD PTR} | wc -l | grep 2
+; RUN: grep {and DWORD PTR} | count 2
target endian = little
target pointersize = 32
diff --git a/test/CodeGen/X86/test-hidden.ll b/test/CodeGen/X86/test-hidden.ll
index e95ca6af6a..058850c7b7 100644
--- a/test/CodeGen/X86/test-hidden.ll
+++ b/test/CodeGen/X86/test-hidden.ll
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu | \
-; RUN: grep .hidden | wc -l | grep 2
+; RUN: grep .hidden | count 2
; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | \
-; RUN: grep .private_extern | wc -l | grep 2
+; RUN: grep .private_extern | count 2
%struct.Person = type { i32 }
@a = hidden global i32 0
diff --git a/test/CodeGen/X86/test-pic-1.ll b/test/CodeGen/X86/test-pic-1.ll
index 4d9703e727..8c19c7d6c6 100644
--- a/test/CodeGen/X86/test-pic-1.ll
+++ b/test/CodeGen/X86/test-pic-1.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | \
; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep GOT %t | wc -l | grep 3
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOT %t | count 3
; RUN: not grep GOTOFF %t | wc -l
@ptr = external global i32*
diff --git a/test/CodeGen/X86/test-pic-2.ll b/test/CodeGen/X86/test-pic-2.ll
index 1d875fa695..40899b35b8 100644
--- a/test/CodeGen/X86/test-pic-2.ll
+++ b/test/CodeGen/X86/test-pic-2.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep GOTOFF %t | wc -l | grep 4
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOTOFF %t | count 4
@ptr = internal global i32* null
@dst = internal global i32 0
diff --git a/test/CodeGen/X86/test-pic-3.ll b/test/CodeGen/X86/test-pic-3.ll
index 91b4761370..bbec68209b 100644
--- a/test/CodeGen/X86/test-pic-3.ll
+++ b/test/CodeGen/X86/test-pic-3.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep PLT %t | wc -l | grep 1
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 1
define void @bar() {
entry:
diff --git a/test/CodeGen/X86/test-pic-4.ll b/test/CodeGen/X86/test-pic-4.ll
index 7637d35fe4..49b9000f12 100644
--- a/test/CodeGen/X86/test-pic-4.ll
+++ b/test/CodeGen/X86/test-pic-4.ll
@@ -1,9 +1,9 @@
; RUN: llvm-as < %s | \
; RUN: llc -mtriple=i686-pc-linux-gnu -relocation-model=pic -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep PLT %t | wc -l | grep 1
-; RUN: grep GOT %t | wc -l | grep 1
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 1
+; RUN: grep GOT %t | count 1
; RUN: not grep GOTOFF %t
@pfoo = external global void(...)*
diff --git a/test/CodeGen/X86/test-pic-5.ll b/test/CodeGen/X86/test-pic-5.ll
index 0ed38b979a..3f7e16934d 100644
--- a/test/CodeGen/X86/test-pic-5.ll
+++ b/test/CodeGen/X86/test-pic-5.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep PLT %t | wc -l | grep 1
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 1
@ptr = external global i32*
diff --git a/test/CodeGen/X86/test-pic-6.ll b/test/CodeGen/X86/test-pic-6.ll
index 43485c301c..d55da1f4c6 100644
--- a/test/CodeGen/X86/test-pic-6.ll
+++ b/test/CodeGen/X86/test-pic-6.ll
@@ -1,8 +1,8 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep GOT %t | wc -l | grep 3
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOT %t | count 3
@ptr = global i32* null
@dst = global i32 0
diff --git a/test/CodeGen/X86/test-pic-cpool.ll b/test/CodeGen/X86/test-pic-cpool.ll
index 79f5607b75..cac31ed2ad 100644
--- a/test/CodeGen/X86/test-pic-cpool.ll
+++ b/test/CodeGen/X86/test-pic-cpool.ll
@@ -1,9 +1,9 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep GOTOFF %t | wc -l | grep 2
-; RUN: grep CPI %t | wc -l | grep 4
+; RUN: grep piclabel %t | count 3
+; RUN: grep GOTOFF %t | count 2
+; RUN: grep CPI %t | count 4
define double @foo(i32 %a.u) {
entry:
diff --git a/test/CodeGen/X86/test-pic-jtbl.ll b/test/CodeGen/X86/test-pic-jtbl.ll
index 516b766595..7347e281fa 100644
--- a/test/CodeGen/X86/test-pic-jtbl.ll
+++ b/test/CodeGen/X86/test-pic-jtbl.ll
@@ -1,10 +1,10 @@
; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic \
; RUN: -o %t -f
; RUN: grep _GLOBAL_OFFSET_TABLE_ %t
-; RUN: grep piclabel %t | wc -l | grep 3
-; RUN: grep PLT %t | wc -l | grep 6
-; RUN: grep GOTOFF %t | wc -l | grep 2
-; RUN: grep JTI %t | wc -l | grep 9
+; RUN: grep piclabel %t | count 3
+; RUN: grep PLT %t | count 6
+; RUN: grep GOTOFF %t | count 2
+; RUN: grep JTI %t | count 9
define void @bar(i32 %n.u) {
entry:
diff --git a/test/CodeGen/X86/vec_extract.ll b/test/CodeGen/X86/vec_extract.ll
index 2d3e87ea46..f0f0a62005 100644
--- a/test/CodeGen/X86/vec_extract.ll
+++ b/test/CodeGen/X86/vec_extract.ll
@@ -1,8 +1,8 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movss %t | wc -l | grep 3
-; RUN: grep movhlps %t | wc -l | grep 1
-; RUN: grep pshufd %t | wc -l | grep 1
-; RUN: grep unpckhpd %t | wc -l | grep 1
+; RUN: grep movss %t | count 3
+; RUN: grep movhlps %t | count 1
+; RUN: grep pshufd %t | count 1
+; RUN: grep unpckhpd %t | count 1
void %test1(<4 x float>* %F, float* %f) {
%tmp = load <4 x float>* %F
diff --git a/test/CodeGen/X86/vec_insert.ll b/test/CodeGen/X86/vec_insert.ll
index 021685e509..8ee0484fda 100644
--- a/test/CodeGen/X86/vec_insert.ll
+++ b/test/CodeGen/X86/vec_insert.ll
@@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movss %t | wc -l | grep 1
-; RUN: grep pinsrw %t | wc -l | grep 2
+; RUN: grep movss %t | count 1
+; RUN: grep pinsrw %t | count 2
void %test(<4 x float>* %F, int %I) {
%tmp = load <4 x float>* %F
diff --git a/test/CodeGen/X86/vec_logical.ll b/test/CodeGen/X86/vec_logical.ll
index 3aac23a4cc..cf45a4a670 100644
--- a/test/CodeGen/X86/vec_logical.ll
+++ b/test/CodeGen/X86/vec_logical.ll
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep andnps
-; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | wc -l | grep 2
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movaps | count 2
define void @t(<4 x float> %A) {
%tmp1277 = sub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %A
diff --git a/test/CodeGen/X86/vec_set-2.ll b/test/CodeGen/X86/vec_set-2.ll
index 1d1449d4e3..ac8936862a 100644
--- a/test/CodeGen/X86/vec_set-2.ll
+++ b/test/CodeGen/X86/vec_set-2.ll
@@ -1,5 +1,5 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | wc -l | grep 1
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movss | count 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movd | count 1
<4 x float> %test1(float %a) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0
diff --git a/test/CodeGen/X86/vec_set-3.ll b/test/CodeGen/X86/vec_set-3.ll
index 1edaa58703..ff108970ac 100644
--- a/test/CodeGen/X86/vec_set-3.ll
+++ b/test/CodeGen/X86/vec_set-3.ll
@@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep shufps %t | wc -l | grep 1
-; RUN: grep pshufd %t | wc -l | grep 1
+; RUN: grep shufps %t | count 1
+; RUN: grep pshufd %t | count 1
<4 x float> %test(float %a) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1
diff --git a/test/CodeGen/X86/vec_set-4.ll b/test/CodeGen/X86/vec_set-4.ll
index c656a5817a..6843cbc36e 100644
--- a/test/CodeGen/X86/vec_set-4.ll
+++ b/test/CodeGen/X86/vec_set-4.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pinsrw | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pinsrw | count 2
<2 x long> %test(short %a) {
entry:
diff --git a/test/CodeGen/X86/vec_set-5.ll b/test/CodeGen/X86/vec_set-5.ll
index 218f0415fd..cf3ac4c978 100644
--- a/test/CodeGen/X86/vec_set-5.ll
+++ b/test/CodeGen/X86/vec_set-5.ll
@@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movlhps %t | wc -l | grep 2
-; RUN: grep unpcklps %t | wc -l | grep 1
-; RUN: grep punpckldq %t | wc -l | grep 1
+; RUN: grep movlhps %t | count 2
+; RUN: grep unpcklps %t | count 1
+; RUN: grep punpckldq %t | count 1
<4 x float> %test1(float %a, float %b) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 0
diff --git a/test/CodeGen/X86/vec_set-6.ll b/test/CodeGen/X86/vec_set-6.ll
index ea6be7412a..ae9e7e6374 100644
--- a/test/CodeGen/X86/vec_set-6.ll
+++ b/test/CodeGen/X86/vec_set-6.ll
@@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep unpcklps %t | wc -l | grep 1
-; RUN: grep shufps %t | wc -l | grep 1
+; RUN: grep unpcklps %t | count 1
+; RUN: grep shufps %t | count 1
<4 x float> %test(float %a, float %b, float %c) {
%tmp = insertelement <4 x float> zeroinitializer, float %a, uint 1
diff --git a/test/CodeGen/X86/vec_set-7.ll b/test/CodeGen/X86/vec_set-7.ll
index ab342df905..d622d96e8b 100644
--- a/test/CodeGen/X86/vec_set-7.ll
+++ b/test/CodeGen/X86/vec_set-7.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movq | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep movq | count 1
<2 x long> %test(<2 x long>* %p) {
%tmp = cast <2 x long>* %p to double*
diff --git a/test/CodeGen/X86/vec_set.ll b/test/CodeGen/X86/vec_set.ll
index c190e41bd0..f955707f3e 100644
--- a/test/CodeGen/X86/vec_set.ll
+++ b/test/CodeGen/X86/vec_set.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpckl | wc -l | grep 7
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep punpckl | count 7
void %test(<8 x short>* %b, short %a0, short %a1, short %a2, short %a3, short %a4, short %a5, short %a6, short %a7) {
%tmp = insertelement <8 x short> zeroinitializer, short %a0, uint 0
diff --git a/test/CodeGen/X86/vec_shuffle-10.ll b/test/CodeGen/X86/vec_shuffle-10.ll
index 34a97c4ffd..e1716dd280 100644
--- a/test/CodeGen/X86/vec_shuffle-10.ll
+++ b/test/CodeGen/X86/vec_shuffle-10.ll
@@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
-; RUN: grep unpcklps | wc -l | grep 1
+; RUN: grep unpcklps | count 1
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
-; RUN: grep unpckhps | wc -l | grep 1
+; RUN: grep unpckhps | count 1
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
; RUN: not grep {sub.*esp}
diff --git a/test/CodeGen/X86/vec_shuffle-2.ll b/test/CodeGen/X86/vec_shuffle-2.ll
index df78323a53..2a909d68e9 100644
--- a/test/CodeGen/X86/vec_shuffle-2.ll
+++ b/test/CodeGen/X86/vec_shuffle-2.ll
@@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep pshufhw %t | wc -l | grep 1
-; RUN: grep pshuflw %t | wc -l | grep 1
-; RUN: grep movhps %t | wc -l | grep 1
+; RUN: grep pshufhw %t | count 1
+; RUN: grep pshuflw %t | count 1
+; RUN: grep movhps %t | count 1
void %test1(<2 x long>* %res, <2 x long>* %A) {
%tmp = load <2 x long>* %A
diff --git a/test/CodeGen/X86/vec_shuffle-3.ll b/test/CodeGen/X86/vec_shuffle-3.ll
index a0ce0f0639..e17545d3e0 100644
--- a/test/CodeGen/X86/vec_shuffle-3.ll
+++ b/test/CodeGen/X86/vec_shuffle-3.ll
@@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movlhps %t | wc -l | grep 1
-; RUN: grep movhlps %t | wc -l | grep 1
+; RUN: grep movlhps %t | count 1
+; RUN: grep movhlps %t | count 1
<4 x float> %test1(<4 x float>* %x, <4 x float>* %y) {
%tmp = load <4 x float>* %y
diff --git a/test/CodeGen/X86/vec_shuffle-4.ll b/test/CodeGen/X86/vec_shuffle-4.ll
index 5bb30bf564..0359b32b86 100644
--- a/test/CodeGen/X86/vec_shuffle-4.ll
+++ b/test/CodeGen/X86/vec_shuffle-4.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 > %t
-; RUN: grep shuf %t | wc -l | grep 2
+; RUN: grep shuf %t | count 2
; RUN: not grep unpck %t
void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B, <4 x float>* %C) {
%tmp3 = load <4 x float>* %B
diff --git a/test/CodeGen/X86/vec_shuffle-5.ll b/test/CodeGen/X86/vec_shuffle-5.ll
index e980a124ee..1b6ebe1216 100644
--- a/test/CodeGen/X86/vec_shuffle-5.ll
+++ b/test/CodeGen/X86/vec_shuffle-5.ll
@@ -1,6 +1,6 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movhlps %t | wc -l | grep 1
-; RUN: grep shufps %t | wc -l | grep 1
+; RUN: grep movhlps %t | count 1
+; RUN: grep shufps %t | count 1
void %test() {
%tmp1 = load <4 x float>* null
diff --git a/test/CodeGen/X86/vec_shuffle-6.ll b/test/CodeGen/X86/vec_shuffle-6.ll
index 661fe09d5c..343ec82da8 100644
--- a/test/CodeGen/X86/vec_shuffle-6.ll
+++ b/test/CodeGen/X86/vec_shuffle-6.ll
@@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep movapd %t | wc -l | grep 1
-; RUN: grep movaps %t | wc -l | grep 1
-; RUN: grep movups %t | wc -l | grep 2
+; RUN: grep movapd %t | count 1
+; RUN: grep movaps %t | count 1
+; RUN: grep movups %t | count 2
target triple = "i686-apple-darwin"
diff --git a/test/CodeGen/X86/vec_shuffle-7.ll b/test/CodeGen/X86/vec_shuffle-7.ll
index ae64c2856a..c846e2a90d 100644
--- a/test/CodeGen/X86/vec_shuffle-7.ll
+++ b/test/CodeGen/X86/vec_shuffle-7.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep xorps %t | wc -l | grep 1
+; RUN: grep xorps %t | count 1
; RUN: not grep shufps %t
void %test() {
diff --git a/test/CodeGen/X86/vec_shuffle-9.ll b/test/CodeGen/X86/vec_shuffle-9.ll
index e83e2984d4..250ee7cb93 100644
--- a/test/CodeGen/X86/vec_shuffle-9.ll
+++ b/test/CodeGen/X86/vec_shuffle-9.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep punpck %t | wc -l | grep 2
+; RUN: grep punpck %t | count 2
; RUN: not grep pextrw %t
<4 x int> %test(sbyte** %ptr) {
diff --git a/test/CodeGen/X86/vec_shuffle.ll b/test/CodeGen/X86/vec_shuffle.ll
index 16ce3dac54..a599fdf9a9 100644
--- a/test/CodeGen/X86/vec_shuffle.ll
+++ b/test/CodeGen/X86/vec_shuffle.ll
@@ -1,7 +1,7 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -o %t -f
-; RUN: grep shufp %t | wc -l | grep 1
-; RUN: grep movupd %t | wc -l | grep 1
-; RUN: grep pshufhw %t | wc -l | grep 1
+; RUN: grep shufp %t | count 1
+; RUN: grep movupd %t | count 1
+; RUN: grep pshufhw %t | count 1
void %test_v4sf(<4 x float>* %P, float %X, float %Y) {
%tmp = insertelement <4 x float> zeroinitializer, float %X, uint 0
diff --git a/test/CodeGen/X86/vec_splat-2.ll b/test/CodeGen/X86/vec_splat-2.ll
index a874500f3d..9e39b2190c 100644
--- a/test/CodeGen/X86/vec_splat-2.ll
+++ b/test/CodeGen/X86/vec_splat-2.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | wc -l | grep 1
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep pshufd | count 1
void %test(<2 x long>* %P, sbyte %x) {
%tmp = insertelement <16 x sbyte> zeroinitializer, sbyte %x, uint 0 ; <<16 x sbyte>> [#uses=1]
diff --git a/test/CodeGen/X86/vec_ss_load_fold.ll b/test/CodeGen/X86/vec_ss_load_fold.ll
index 1c9f6f1e0d..1ea87c128c 100644
--- a/test/CodeGen/X86/vec_ss_load_fold.ll
+++ b/test/CodeGen/X86/vec_ss_load_fold.ll
@@ -1,5 +1,5 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse,+sse2 -o %t -f
-; RUN: grep minss %t | grep CPI | wc -l | grep 2
+; RUN: grep minss %t | grep CPI | count 2
; RUN: grep CPI %t | not grep movss
target endian = little
diff --git a/test/CodeGen/X86/vec_zero.ll b/test/CodeGen/X86/vec_zero.ll
index f976fc1834..0f94174b34 100644
--- a/test/CodeGen/X86/vec_zero.ll
+++ b/test/CodeGen/X86/vec_zero.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | wc -l | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep xorps | count 2
void %foo(<4 x float> *%P) {
%T = load <4 x float> * %P
diff --git a/test/CodeGen/X86/x86-64-mem.ll b/test/CodeGen/X86/x86-64-mem.ll
index 1e942c5c19..930383d8e9 100644
--- a/test/CodeGen/X86/x86-64-mem.ll
+++ b/test/CodeGen/X86/x86-64-mem.ll
@@ -1,13 +1,13 @@
; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -o %t1 -f
-; RUN: grep GOTPCREL %t1 | wc -l | grep 4
-; RUN: grep rip %t1 | wc -l | grep 6
-; RUN: grep movq %t1 | wc -l | grep 6
-; RUN: grep leaq %t1 | wc -l | grep 1
+; RUN: grep GOTPCREL %t1 | count 4
+; RUN: grep rip %t1 | count 6
+; RUN: grep movq %t1 | count 6
+; RUN: grep leaq %t1 | count 1
; RUN: llvm-upgrade < %s | llvm-as | \
; RUN: llc -mtriple=x86_64-pc-linux -relocation-model=static -o %t2 -f
-; RUN: grep rip %t2 | wc -l | grep 4
-; RUN: grep movl %t2 | wc -l | grep 2
-; RUN: grep movq %t2 | wc -l | grep 2
+; RUN: grep rip %t2 | count 4
+; RUN: grep movl %t2 | count 2
+; RUN: grep movq %t2 | count 2
%ptr = external global int*
%src = external global [0 x int]