aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/ARM/2007-03-13-InstrSched.ll2
-rw-r--r--test/CodeGen/ARM/2007-04-03-PEIBug.ll2
-rw-r--r--test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll2
-rw-r--r--test/CodeGen/ARM/2009-04-06-AsmModifier.ll2
-rw-r--r--test/CodeGen/ARM/2011-12-14-machine-sink.ll2
-rw-r--r--test/CodeGen/ARM/2012-01-24-RegSequenceLiveRange.ll8
-rw-r--r--test/CodeGen/ARM/addrmode.ll2
-rw-r--r--test/CodeGen/ARM/aliases.ll2
-rw-r--r--test/CodeGen/ARM/bicZext.ll19
-rw-r--r--test/CodeGen/ARM/call_nolink.ll2
-rw-r--r--test/CodeGen/ARM/cse-libcalls.ll2
-rw-r--r--test/CodeGen/ARM/divmod.ll16
-rw-r--r--test/CodeGen/ARM/fusedMAC.ll23
-rw-r--r--test/CodeGen/ARM/iabs.ll20
-rw-r--r--test/CodeGen/ARM/lsr-scale-addr-mode.ll2
-rw-r--r--test/CodeGen/ARM/neon_div.ll6
-rw-r--r--test/CodeGen/ARM/pr13249.ll27
-rw-r--r--test/CodeGen/ARM/str_pre.ll2
-rw-r--r--test/CodeGen/ARM/struct_byval.ll14
-rw-r--r--test/CodeGen/ARM/sub.ll12
-rw-r--r--test/CodeGen/ARM/thread_pointer.ll2
-rw-r--r--test/CodeGen/ARM/thumb2-it-block.ll4
-rw-r--r--test/CodeGen/ARM/tls-models.ll117
-rw-r--r--test/CodeGen/ARM/tls1.ll6
-rw-r--r--test/CodeGen/ARM/tls3.ll2
-rw-r--r--test/CodeGen/CellSPU/icmp16.ll246
-rw-r--r--test/CodeGen/CellSPU/icmp32.ll249
-rw-r--r--test/CodeGen/CellSPU/icmp8.ll180
-rw-r--r--test/CodeGen/CellSPU/shift_ops.ll32
-rw-r--r--test/CodeGen/CellSPU/stores.ll6
-rw-r--r--test/CodeGen/CellSPU/trunc.ll28
-rw-r--r--test/CodeGen/Generic/APIntLoadStore.ll1
-rw-r--r--test/CodeGen/Generic/asm-large-immediate.ll6
-rw-r--r--test/CodeGen/Generic/donothing.ll31
-rw-r--r--test/CodeGen/Generic/print-after.ll6
-rw-r--r--test/CodeGen/Generic/print-machineinstrs.ll6
-rw-r--r--test/CodeGen/Generic/stop-after.ll10
-rw-r--r--test/CodeGen/Generic/undef-phi.ll26
-rw-r--r--test/CodeGen/Mips/2008-07-23-fpcmp.ll4
-rw-r--r--test/CodeGen/Mips/2008-07-29-icmp.ll2
-rw-r--r--test/CodeGen/Mips/2010-07-20-Switch.ll26
-rw-r--r--test/CodeGen/Mips/asm-large-immediate.ll10
-rw-r--r--test/CodeGen/Mips/fastcc.ll253
-rw-r--r--test/CodeGen/Mips/i64arg.ll4
-rw-r--r--test/CodeGen/Mips/inlineasm-cnstrnt-bad-r-1.ll17
-rw-r--r--test/CodeGen/Mips/inlineasm-operand-code.ll18
-rw-r--r--test/CodeGen/Mips/largeimmprinting.ll2
-rw-r--r--test/CodeGen/Mips/longbranch.ll23
-rw-r--r--test/CodeGen/Mips/machineverifier.ll21
-rw-r--r--test/CodeGen/Mips/memcpy.ll19
-rw-r--r--test/CodeGen/Mips/o32_cc_byval.ll58
-rw-r--r--test/CodeGen/Mips/o32_cc_vararg.ll68
-rw-r--r--test/CodeGen/Mips/stacksize.ll9
-rw-r--r--test/CodeGen/Mips/tls-alias.ll10
-rw-r--r--test/CodeGen/Mips/tls-models.ll113
-rw-r--r--test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll2
-rw-r--r--test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll2
-rw-r--r--test/CodeGen/PowerPC/2006-04-05-splat-ish.ll2
-rw-r--r--test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll4
-rw-r--r--test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll2
-rw-r--r--test/CodeGen/PowerPC/Frames-leaf.ll32
-rw-r--r--test/CodeGen/PowerPC/Frames-small.ll32
-rw-r--r--test/CodeGen/PowerPC/LargeAbsoluteAddr.ll6
-rw-r--r--test/CodeGen/PowerPC/a2-fp-basic.ll2
-rw-r--r--test/CodeGen/PowerPC/and-imm.ll2
-rw-r--r--test/CodeGen/PowerPC/big-endian-actual-args.ll4
-rw-r--r--test/CodeGen/PowerPC/big-endian-call-result.ll4
-rw-r--r--test/CodeGen/PowerPC/branch-opt.ll2
-rw-r--r--test/CodeGen/PowerPC/calls.ll6
-rw-r--r--test/CodeGen/PowerPC/coalesce-ext.ll17
-rw-r--r--test/CodeGen/PowerPC/compare-simm.ll2
-rw-r--r--test/CodeGen/PowerPC/constants.ll2
-rw-r--r--test/CodeGen/PowerPC/ctrloop-s000.ll156
-rw-r--r--test/CodeGen/PowerPC/ctrloop-sums.ll134
-rw-r--r--test/CodeGen/PowerPC/darwin-labels.ll2
-rw-r--r--test/CodeGen/PowerPC/fabs.ll2
-rw-r--r--test/CodeGen/PowerPC/fma.ll4
-rw-r--r--test/CodeGen/PowerPC/fsqrt.ll8
-rw-r--r--test/CodeGen/PowerPC/iabs.ll4
-rw-r--r--test/CodeGen/PowerPC/isel.ll23
-rw-r--r--test/CodeGen/PowerPC/ispositive.ll2
-rw-r--r--test/CodeGen/PowerPC/lbzux.ll49
-rw-r--r--test/CodeGen/PowerPC/long-compare.ll4
-rw-r--r--test/CodeGen/PowerPC/lsr-postinc-pos.ll2
-rw-r--r--test/CodeGen/PowerPC/no-dead-strip.ll2
-rw-r--r--test/CodeGen/PowerPC/ppc440-fp-basic.ll2
-rw-r--r--test/CodeGen/PowerPC/retaddr.ll2
-rw-r--r--test/CodeGen/PowerPC/rlwimi-commute.ll2
-rw-r--r--test/CodeGen/PowerPC/rlwimi3.ll4
-rw-r--r--test/CodeGen/PowerPC/seteq-0.ll2
-rw-r--r--test/CodeGen/PowerPC/small-arguments.ll2
-rw-r--r--test/CodeGen/PowerPC/stack-protector.ll4
-rw-r--r--test/CodeGen/PowerPC/stwu-gta.ll22
-rw-r--r--test/CodeGen/PowerPC/stwux.ll47
-rw-r--r--test/CodeGen/PowerPC/trampoline.ll2
-rw-r--r--test/CodeGen/Thumb/asmprinter-bug.ll2
-rw-r--r--test/CodeGen/Thumb/frame_thumb.ll4
-rw-r--r--test/CodeGen/Thumb/iabs.ll4
-rw-r--r--test/CodeGen/Thumb2/2010-01-06-TailDuplicateLabels.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-ldr_post.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-ldr_pre.ll4
-rw-r--r--test/CodeGen/Thumb2/thumb2-rev16.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-ror.ll6
-rw-r--r--test/CodeGen/Thumb2/tls1.ll6
-rw-r--r--test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll2
-rw-r--r--test/CodeGen/X86/2003-11-03-GlobalBool.ll2
-rw-r--r--test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll6
-rw-r--r--test/CodeGen/X86/2004-03-30-Select-Max.ll2
-rw-r--r--test/CodeGen/X86/2006-03-01-InstrSchedBug.ll2
-rw-r--r--test/CodeGen/X86/2006-03-02-InstrSchedBug.ll2
-rw-r--r--test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll4
-rw-r--r--test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll4
-rw-r--r--test/CodeGen/X86/2006-05-02-InstrSched1.ll2
-rw-r--r--test/CodeGen/X86/2006-05-02-InstrSched2.ll2
-rw-r--r--test/CodeGen/X86/2006-05-08-InstrSched.ll2
-rw-r--r--test/CodeGen/X86/2006-05-11-InstrSched.ll4
-rw-r--r--test/CodeGen/X86/2006-07-31-SingleRegClass.ll4
-rw-r--r--test/CodeGen/X86/2006-08-21-ExtraMovInst.ll2
-rw-r--r--test/CodeGen/X86/2006-11-17-IllegalMove.ll2
-rw-r--r--test/CodeGen/X86/2007-01-13-StackPtrIndex.ll2
-rw-r--r--test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll2
-rw-r--r--test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll2
-rw-r--r--test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll2
-rw-r--r--test/CodeGen/X86/2007-05-07-InvokeSRet.ll2
-rw-r--r--test/CodeGen/X86/2007-08-10-SignExtSubreg.ll2
-rw-r--r--test/CodeGen/X86/2007-09-05-InvalidAsm.ll2
-rw-r--r--test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll2
-rw-r--r--test/CodeGen/X86/2007-12-18-LoadCSEBug.ll2
-rw-r--r--test/CodeGen/X86/2008-02-18-TailMergingBug.ll2
-rw-r--r--test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll4
-rw-r--r--test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll2
-rw-r--r--test/CodeGen/X86/2008-04-16-ReMatBug.ll2
-rw-r--r--test/CodeGen/X86/2008-04-17-CoalescerBug.ll2
-rw-r--r--test/CodeGen/X86/2008-04-28-CoalescerBug.ll6
-rw-r--r--test/CodeGen/X86/2008-08-06-CmpStride.ll2
-rw-r--r--test/CodeGen/X86/2008-08-31-EH_RETURN32.ll27
-rw-r--r--test/CodeGen/X86/2008-10-24-FlippedCompare.ll2
-rw-r--r--test/CodeGen/X86/2008-10-27-CoalescerBug.ll2
-rw-r--r--test/CodeGen/X86/2008-12-23-crazy-address.ll2
-rw-r--r--test/CodeGen/X86/2009-01-31-BigShift2.ll2
-rw-r--r--test/CodeGen/X86/2009-02-25-CommuteBug.ll2
-rw-r--r--test/CodeGen/X86/2009-02-26-MachineLICMBug.ll2
-rw-r--r--test/CodeGen/X86/2009-03-12-CPAlignBug.ll2
-rw-r--r--test/CodeGen/X86/2009-03-23-MultiUseSched.ll4
-rw-r--r--test/CodeGen/X86/2009-04-16-SpillerUnfold.ll2
-rw-r--r--test/CodeGen/X86/2009-04-24.ll4
-rw-r--r--test/CodeGen/X86/2009-04-29-IndirectDestOperands.ll2
-rw-r--r--test/CodeGen/X86/2009-05-30-ISelBug.ll2
-rw-r--r--test/CodeGen/X86/20090313-signext.ll4
-rw-r--r--test/CodeGen/X86/2010-01-19-OptExtBug.ll2
-rw-r--r--test/CodeGen/X86/2011-06-12-FastAllocSpill.ll2
-rw-r--r--test/CodeGen/X86/2012-03-26-PostRALICMBug.ll4
-rw-r--r--test/CodeGen/X86/MachineSink-PHIUse.ll2
-rw-r--r--test/CodeGen/X86/addr-label-difference.ll2
-rw-r--r--test/CodeGen/X86/aligned-comm.ll4
-rw-r--r--test/CodeGen/X86/alloca-align-rounding-32.ll1
-rw-r--r--test/CodeGen/X86/alloca-align-rounding.ll1
-rw-r--r--test/CodeGen/X86/asm-reg-type-mismatch.ll (renamed from test/CodeGen/X86/2008-08-25-AsmRegTypeMismatch.ll)19
-rwxr-xr-xtest/CodeGen/X86/avx-shuffle-x86_32.ll2
-rw-r--r--test/CodeGen/X86/avx-shuffle.ll33
-rw-r--r--test/CodeGen/X86/avx2-intrinsics-x86.ll160
-rw-r--r--test/CodeGen/X86/avx2-vbroadcast.ll96
-rw-r--r--test/CodeGen/X86/break-anti-dependencies.ll8
-rw-r--r--test/CodeGen/X86/call-imm.ll8
-rw-r--r--test/CodeGen/X86/coalesce-esp.ll2
-rw-r--r--test/CodeGen/X86/constructor.ll27
-rw-r--r--test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll4
-rw-r--r--test/CodeGen/X86/crash.ll39
-rw-r--r--test/CodeGen/X86/dagcombine-cse.ll2
-rw-r--r--test/CodeGen/X86/dynamic-allocas-VLAs.ll158
-rw-r--r--test/CodeGen/X86/epilogue.ll2
-rw-r--r--test/CodeGen/X86/extractps.ll4
-rw-r--r--test/CodeGen/X86/fast-cc-merge-stack-adj.ll2
-rw-r--r--test/CodeGen/X86/fast-isel-constpool.ll2
-rw-r--r--test/CodeGen/X86/fast-isel-gv.ll2
-rw-r--r--test/CodeGen/X86/fastcc-byval.ll2
-rw-r--r--test/CodeGen/X86/force-align-stack-alloca.ll63
-rw-r--r--test/CodeGen/X86/fp-immediate-shorten.ll2
-rw-r--r--test/CodeGen/X86/fp_load_fold.ll2
-rw-r--r--test/CodeGen/X86/full-lsr.ll4
-rw-r--r--test/CodeGen/X86/h-register-addressing-32.ll2
-rw-r--r--test/CodeGen/X86/h-register-addressing-64.ll2
-rw-r--r--test/CodeGen/X86/h-registers-1.ll4
-rw-r--r--test/CodeGen/X86/hoist-invariant-load.ll2
-rw-r--r--test/CodeGen/X86/illegal-vector-args-return.ll8
-rw-r--r--test/CodeGen/X86/inline-asm-modifier-n.ll2
-rw-r--r--test/CodeGen/X86/isel-sink2.ll2
-rw-r--r--test/CodeGen/X86/ispositive.ll2
-rw-r--r--test/CodeGen/X86/label-redefinition.ll2
-rw-r--r--test/CodeGen/X86/large-global.ll11
-rw-r--r--test/CodeGen/X86/lea-2.ll2
-rw-r--r--test/CodeGen/X86/multiple-loop-post-inc.ll8
-rw-r--r--test/CodeGen/X86/overlap-shift.ll2
-rw-r--r--test/CodeGen/X86/peep-vector-extract-insert.ll2
-rw-r--r--test/CodeGen/X86/phi-immediate-factoring.ll2
-rw-r--r--test/CodeGen/X86/pr2656.ll2
-rw-r--r--test/CodeGen/X86/pr3522.ll2
-rw-r--r--test/CodeGen/X86/regpressure.ll4
-rw-r--r--test/CodeGen/X86/remat-scalar-zero.ll2
-rw-r--r--test/CodeGen/X86/rotate.ll2
-rw-r--r--test/CodeGen/X86/shift-coalesce.ll4
-rw-r--r--test/CodeGen/X86/shift-double.ll2
-rw-r--r--test/CodeGen/X86/shl_elim.ll6
-rw-r--r--test/CodeGen/X86/sse_reload_fold.ll2
-rw-r--r--test/CodeGen/X86/stack-protector-linux.ll4
-rw-r--r--test/CodeGen/X86/subreg-to-reg-1.ll2
-rw-r--r--test/CodeGen/X86/subreg-to-reg-4.ll2
-rw-r--r--test/CodeGen/X86/tailcallbyval.ll2
-rw-r--r--test/CodeGen/X86/tls-models.ll166
-rw-r--r--test/CodeGen/X86/twoaddr-coalesce-2.ll4
-rw-r--r--test/CodeGen/X86/twoaddr-pass-sink.ll2
-rw-r--r--test/CodeGen/X86/uint_to_fp.ll2
-rw-r--r--test/CodeGen/X86/umul-with-carry.ll2
-rw-r--r--test/CodeGen/X86/unwindraise.ll252
-rw-r--r--test/CodeGen/X86/vec_call.ll4
-rw-r--r--test/CodeGen/X86/vec_ins_extract-1.ll2
-rw-r--r--test/CodeGen/X86/vec_set-9.ll2
-rw-r--r--test/CodeGen/X86/x86-64-arg.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-1.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-10.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-11.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-2.ll4
-rw-r--r--test/CodeGen/X86/x86-64-pic-3.ll4
-rw-r--r--test/CodeGen/X86/x86-64-pic-4.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-5.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-6.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-7.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-8.ll2
-rw-r--r--test/CodeGen/X86/x86-64-pic-9.ll2
-rw-r--r--test/CodeGen/XCore/mkmsk.ll11
230 files changed, 3174 insertions, 608 deletions
diff --git a/test/CodeGen/ARM/2007-03-13-InstrSched.ll b/test/CodeGen/ARM/2007-03-13-InstrSched.ll
index 33f935e960..a63cdd46e2 100644
--- a/test/CodeGen/ARM/2007-03-13-InstrSched.ll
+++ b/test/CodeGen/ARM/2007-03-13-InstrSched.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic \
; RUN: -mattr=+v6 | grep r9
; RUN: llc < %s -mtriple=arm-apple-darwin -relocation-model=pic \
-; RUN: -mattr=+v6 -arm-reserve-r9 -ifcvt-limit=0 -stats |& grep asm-printer
+; RUN: -mattr=+v6 -arm-reserve-r9 -ifcvt-limit=0 -stats 2>&1 | grep asm-printer
; | grep 35
define void @test(i32 %tmp56222, i32 %tmp36224, i32 %tmp46223, i32 %i.0196.0.ph, i32 %tmp8, i32* %tmp1011, i32** %tmp1, i32* %d2.1.out, i32* %d3.1.out, i32* %d0.1.out, i32* %d1.1.out) {
diff --git a/test/CodeGen/ARM/2007-04-03-PEIBug.ll b/test/CodeGen/ARM/2007-04-03-PEIBug.ll
index b543c57e1a..8d3337c29f 100644
--- a/test/CodeGen/ARM/2007-04-03-PEIBug.ll
+++ b/test/CodeGen/ARM/2007-04-03-PEIBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm | not grep {add.*#0}
+; RUN: llc < %s -march=arm | not grep "add.*#0"
define i32 @foo() {
entry:
diff --git a/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll b/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll
index d2eb85d356..670048bf25 100644
--- a/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll
+++ b/test/CodeGen/ARM/2007-05-23-BadPreIndexedStore.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm | not grep {str.*\\!}
+; RUN: llc < %s -march=arm | not grep "str.*\!"
%struct.shape_edge_t = type { %struct.shape_edge_t*, %struct.shape_edge_t*, i32, i32, i32, i32 }
%struct.shape_path_t = type { %struct.shape_edge_t*, %struct.shape_edge_t*, i32, i32, i32, i32, i32, i32 }
diff --git a/test/CodeGen/ARM/2009-04-06-AsmModifier.ll b/test/CodeGen/ARM/2009-04-06-AsmModifier.ll
index 352672274d..7342f69631 100644
--- a/test/CodeGen/ARM/2009-04-06-AsmModifier.ll
+++ b/test/CodeGen/ARM/2009-04-06-AsmModifier.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm | grep {swi 107}
+; RUN: llc < %s -march=arm | grep "swi 107"
define i32 @_swilseek(i32) nounwind {
entry:
diff --git a/test/CodeGen/ARM/2011-12-14-machine-sink.ll b/test/CodeGen/ARM/2011-12-14-machine-sink.ll
index 5ce600d1a9..b21bb006e3 100644
--- a/test/CodeGen/ARM/2011-12-14-machine-sink.ll
+++ b/test/CodeGen/ARM/2011-12-14-machine-sink.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -o /dev/null -stats |& FileCheck %s -check-prefix=STATS
+; RUN: llc < %s -o /dev/null -stats 2>&1 | FileCheck %s -check-prefix=STATS
; Radar 10266272
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
target triple = "thumbv7-apple-ios4.0.0"
diff --git a/test/CodeGen/ARM/2012-01-24-RegSequenceLiveRange.ll b/test/CodeGen/ARM/2012-01-24-RegSequenceLiveRange.ll
index 872eca34ad..f1c85f1b41 100644
--- a/test/CodeGen/ARM/2012-01-24-RegSequenceLiveRange.ll
+++ b/test/CodeGen/ARM/2012-01-24-RegSequenceLiveRange.ll
@@ -60,8 +60,16 @@ for.end: ; preds = %entry
ret void
}
+; Check that pseudo-expansion preserves <undef> flags.
+define void @foo3(i8* %p) nounwind ssp {
+entry:
+ tail call void @llvm.arm.neon.vst2.v4f32(i8* %p, <4 x float> undef, <4 x float> undef, i32 4)
+ ret void
+}
+
declare arm_aapcs_vfpcc void @bar(i8*, float, float, float)
declare void @llvm.arm.neon.vst1.v4f32(i8*, <4 x float>, i32) nounwind
+declare void @llvm.arm.neon.vst2.v4f32(i8*, <4 x float>, <4 x float>, i32) nounwind
!0 = metadata !{metadata !"omnipotent char", metadata !1}
!1 = metadata !{metadata !"Simple C/C++ TBAA", null}
diff --git a/test/CodeGen/ARM/addrmode.ll b/test/CodeGen/ARM/addrmode.ll
index 9ccff07d45..6da90897b9 100644
--- a/test/CodeGen/ARM/addrmode.ll
+++ b/test/CodeGen/ARM/addrmode.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm -stats |& grep asm-printer | grep 4
+; RUN: llc < %s -march=arm -stats 2>&1 | grep asm-printer | grep 4
define i32 @t1(i32 %a) {
%b = mul i32 %a, 9
diff --git a/test/CodeGen/ARM/aliases.ll b/test/CodeGen/ARM/aliases.ll
index 31c500756c..d668334f8d 100644
--- a/test/CodeGen/ARM/aliases.ll
+++ b/test/CodeGen/ARM/aliases.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=arm-linux-gnueabi -o %t
-; RUN: grep { = } %t | count 5
+; RUN: grep " = " %t | count 5
; RUN: grep globl %t | count 4
; RUN: grep weak %t | count 1
diff --git a/test/CodeGen/ARM/bicZext.ll b/test/CodeGen/ARM/bicZext.ll
new file mode 100644
index 0000000000..cf4b7ba0e0
--- /dev/null
+++ b/test/CodeGen/ARM/bicZext.ll
@@ -0,0 +1,19 @@
+; RUN: llc %s -o - | FileCheck %s
+; ModuleID = 'bic.c'
+target triple = "thumbv7-apple-ios3.0.0"
+
+define zeroext i16 @foo16(i16 zeroext %f) nounwind readnone optsize ssp {
+entry:
+ ; CHECK: .thumb_func _foo16
+ ; CHECK: {{bic[^#]*#3}}
+ %and = and i16 %f, -4
+ ret i16 %and
+}
+
+define i32 @foo32(i32 %f) nounwind readnone optsize ssp {
+entry:
+ ; CHECK: .thumb_func _foo32
+ ; CHECK: {{bic[^#]*#3}}
+ %and = and i32 %f, -4
+ ret i32 %and
+}
diff --git a/test/CodeGen/ARM/call_nolink.ll b/test/CodeGen/ARM/call_nolink.ll
index efe29d857d..00b16888f3 100644
--- a/test/CodeGen/ARM/call_nolink.ll
+++ b/test/CodeGen/ARM/call_nolink.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: not grep {bx lr}
+; RUN: not grep "bx lr"
%struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
@r = external global [14 x i32] ; <[14 x i32]*> [#uses=4]
diff --git a/test/CodeGen/ARM/cse-libcalls.ll b/test/CodeGen/ARM/cse-libcalls.ll
index 1d011be93c..62b9e4380b 100644
--- a/test/CodeGen/ARM/cse-libcalls.ll
+++ b/test/CodeGen/ARM/cse-libcalls.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm | grep {bl.\*__ltdf} | count 1
+; RUN: llc < %s -march=arm | grep "bl.*__ltdf" | count 1
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-f80:128:128"
target triple = "i386-apple-darwin8"
diff --git a/test/CodeGen/ARM/divmod.ll b/test/CodeGen/ARM/divmod.ll
index 49c4103757..7fbf8f4090 100644
--- a/test/CodeGen/ARM/divmod.ll
+++ b/test/CodeGen/ARM/divmod.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=arm-apple-ios5.0 | FileCheck %s
+; RUN: llc < %s -mtriple=arm-apple-ios5.0 -mcpu=cortex-a8 | FileCheck %s
define void @foo(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp {
entry:
@@ -56,3 +56,17 @@ bb1:
declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readnone
declare i8* @__memset_chk(i8*, i32, i32, i32) nounwind
+
+; rdar://11714607
+define i32 @howmany(i32 %x, i32 %y) nounwind {
+entry:
+; CHECK: howmany:
+; CHECK: bl ___udivmodsi4
+; CHECK-NOT: ___udivsi3
+ %rem = urem i32 %x, %y
+ %div = udiv i32 %x, %y
+ %not.cmp = icmp ne i32 %rem, 0
+ %add = zext i1 %not.cmp to i32
+ %cond = add i32 %add, %div
+ ret i32 %cond
+}
diff --git a/test/CodeGen/ARM/fusedMAC.ll b/test/CodeGen/ARM/fusedMAC.ll
index 3bf1ef4ad2..303d165de0 100644
--- a/test/CodeGen/ARM/fusedMAC.ll
+++ b/test/CodeGen/ARM/fusedMAC.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=armv7-eabi -mattr=+neon,+vfp4 | FileCheck %s
+; RUN: llc < %s -mtriple=armv7-eabi -mattr=+neon,+vfp4 -fp-contract=fast | FileCheck %s
; Check generated fused MAC and MLS.
define double @fusedMACTest1(double %d1, double %d2, double %d3) {
@@ -141,6 +141,15 @@ entry:
ret double %tmp2
}
+define float @test_fnms_f32(float %a, float %b, float* %c) nounwind readnone ssp {
+; CHECK: test_fnms_f32
+; CHECK: vfnms.f32
+ %tmp1 = load float* %c, align 4
+ %tmp2 = fsub float -0.0, %tmp1
+ %tmp3 = tail call float @llvm.fma.f32(float %a, float %b, float %tmp2) nounwind readnone
+ ret float %tmp3
+}
+
define double @test_fnms_f64(double %a, double %b, double %c) nounwind readnone ssp {
entry:
; CHECK: test_fnms_f64
@@ -197,7 +206,19 @@ define float @test_fma_canonicalize(float %a, float %b) nounwind {
ret float %ret
}
+; Check that very wide vector fma's can be split into legal fma's.
+define void @test_fma_v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x float>* %p) nounwind readnone ssp {
+; CHECK: test_fma_v8f32
+; CHECK: vfma.f32
+; CHECK: vfma.f32
+entry:
+ %call = tail call <8 x float> @llvm.fma.v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %c) nounwind readnone
+ store <8 x float> %call, <8 x float>* %p, align 16
+ ret void
+}
+
declare float @llvm.fma.f32(float, float, float) nounwind readnone
declare double @llvm.fma.f64(double, double, double) nounwind readnone
declare <2 x float> @llvm.fma.v2f32(<2 x float>, <2 x float>, <2 x float>) nounwind readnone
+declare <8 x float> @llvm.fma.v8f32(<8 x float>, <8 x float>, <8 x float>) nounwind readnone
diff --git a/test/CodeGen/ARM/iabs.ll b/test/CodeGen/ARM/iabs.ll
index 89e309d160..600a8c29ea 100644
--- a/test/CodeGen/ARM/iabs.ll
+++ b/test/CodeGen/ARM/iabs.ll
@@ -10,7 +10,25 @@ define i32 @test(i32 %a) {
%b = icmp sgt i32 %a, -1
%abs = select i1 %b, i32 %a, i32 %tmp1neg
ret i32 %abs
-; CHECK: movs r0, r0
+; CHECK: cmp
; CHECK: rsbmi r0, r0, #0
; CHECK: bx lr
}
+
+; rdar://11633193
+;; 3 instructions will be generated for abs(a-b):
+;; subs
+;; rsbmi
+;; bx
+define i32 @test2(i32 %a, i32 %b) nounwind readnone ssp {
+entry:
+; CHECK: test2
+; CHECK: subs
+; CHECK-NEXT: rsbmi
+; CHECK-NEXT: bx
+ %sub = sub nsw i32 %a, %b
+ %cmp = icmp sgt i32 %sub, -1
+ %sub1 = sub nsw i32 0, %sub
+ %cond = select i1 %cmp, i32 %sub, i32 %sub1
+ ret i32 %cond
+}
diff --git a/test/CodeGen/ARM/lsr-scale-addr-mode.ll b/test/CodeGen/ARM/lsr-scale-addr-mode.ll
index 8130019cbf..0c8d387489 100644
--- a/test/CodeGen/ARM/lsr-scale-addr-mode.ll
+++ b/test/CodeGen/ARM/lsr-scale-addr-mode.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=arm | grep lsl | grep -F {lsl #2\]}
+; RUN: llc < %s -march=arm | grep lsl | grep -F "lsl #2]"
; Should use scaled addressing mode.
define void @sintzero(i32* %a) nounwind {
diff --git a/test/CodeGen/ARM/neon_div.ll b/test/CodeGen/ARM/neon_div.ll
index de48feeb9e..4a82c36676 100644
--- a/test/CodeGen/ARM/neon_div.ll
+++ b/test/CodeGen/ARM/neon_div.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s -march=arm -mattr=+neon -pre-RA-sched=source | FileCheck %s
+; RUN: llc < %s -march=arm -mattr=+neon -pre-RA-sched=source -disable-post-ra | FileCheck %s
define <8 x i8> @sdivi8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
;CHECK: vrecpe.f32
-;CHECK: vrecpe.f32
;CHECK: vmovn.i32
+;CHECK: vrecpe.f32
;CHECK: vmovn.i32
;CHECK: vmovn.i16
%tmp1 = load <8 x i8>* %A
@@ -15,10 +15,10 @@ define <8 x i8> @sdivi8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
define <8 x i8> @udivi8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
;CHECK: vrecpe.f32
;CHECK: vrecps.f32
+;CHECK: vmovn.i32
;CHECK: vrecpe.f32
;CHECK: vrecps.f32
;CHECK: vmovn.i32
-;CHECK: vmovn.i32
;CHECK: vqmovun.s16
%tmp1 = load <8 x i8>* %A
%tmp2 = load <8 x i8>* %B
diff --git a/test/CodeGen/ARM/pr13249.ll b/test/CodeGen/ARM/pr13249.ll
new file mode 100644
index 0000000000..4bc8810354
--- /dev/null
+++ b/test/CodeGen/ARM/pr13249.ll
@@ -0,0 +1,27 @@
+; RUN: llc < %s -mtriple armv7--linux-gnueabi
+
+define arm_aapcscc i8* @__strtok_r_1c(i8* %arg, i8 signext %arg1, i8** nocapture %arg2) nounwind {
+bb:
+ br label %bb3
+
+bb3: ; preds = %bb3, %bb
+ %tmp = phi i8* [ %tmp5, %bb3 ], [ %arg, %bb ]
+ %tmp4 = load i8* %tmp, align 1
+ %tmp5 = getelementptr inbounds i8* %tmp, i32 1
+ br i1 undef, label %bb3, label %bb7
+
+bb7: ; preds = %bb13, %bb3
+ %tmp8 = phi i8 [ %tmp14, %bb13 ], [ %tmp4, %bb3 ]
+ %tmp9 = phi i8* [ %tmp12, %bb13 ], [ %tmp, %bb3 ]
+ %tmp10 = icmp ne i8 %tmp8, %arg1
+ %tmp12 = getelementptr inbounds i8* %tmp9, i32 1
+ br i1 %tmp10, label %bb13, label %bb15
+
+bb13: ; preds = %bb7
+ %tmp14 = load i8* %tmp12, align 1
+ br label %bb7
+
+bb15: ; preds = %bb7
+ store i8* %tmp9, i8** %arg2, align 4
+ ret i8* %tmp
+}
diff --git a/test/CodeGen/ARM/str_pre.ll b/test/CodeGen/ARM/str_pre.ll
index e56e3f253e..d8b3f0e767 100644
--- a/test/CodeGen/ARM/str_pre.ll
+++ b/test/CodeGen/ARM/str_pre.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=arm | \
-; RUN: grep {str.*\\!} | count 2
+; RUN: grep "str.*\!" | count 2
define void @test1(i32* %X, i32* %A, i32** %dest) {
%B = load i32* %A ; <i32> [#uses=1]
diff --git a/test/CodeGen/ARM/struct_byval.ll b/test/CodeGen/ARM/struct_byval.ll
index 0c2f7398cb..99ba475ad7 100644
--- a/test/CodeGen/ARM/struct_byval.ll
+++ b/test/CodeGen/ARM/struct_byval.ll
@@ -28,5 +28,19 @@ entry:
ret i32 0
}
+; Generate a loop using NEON instructions
+define i32 @h() nounwind ssp {
+entry:
+; CHECK: h:
+; CHECK: vld1
+; CHECK: sub
+; CHECK: vst1
+; CHECK: bne
+ %st = alloca %struct.LargeStruct, align 16
+ %call = call i32 @e3(%struct.LargeStruct* byval align 16 %st)
+ ret i32 0
+}
+
declare i32 @e1(%struct.SmallStruct* nocapture byval %in) nounwind
declare i32 @e2(%struct.LargeStruct* nocapture byval %in) nounwind
+declare i32 @e3(%struct.LargeStruct* nocapture byval align 16 %in) nounwind
diff --git a/test/CodeGen/ARM/sub.ll b/test/CodeGen/ARM/sub.ll
index 06ea703fc7..474043afc1 100644
--- a/test/CodeGen/ARM/sub.ll
+++ b/test/CodeGen/ARM/sub.ll
@@ -36,3 +36,15 @@ entry:
%sel = select i1 %cmp, i32 1, i32 %sub
ret i32 %sel
}
+
+; rdar://11726136
+define i32 @f5(i32 %x) {
+entry:
+; CHECK: f5
+; CHECK: movw r1, #65535
+; CHECK-NOT: movt
+; CHECK-NOT: add
+; CHECK: sub r0, r0, r1
+ %sub = add i32 %x, -65535
+ ret i32 %sub
+}
diff --git a/test/CodeGen/ARM/thread_pointer.ll b/test/CodeGen/ARM/thread_pointer.ll
index 3143387ead..c403fa5c4a 100644
--- a/test/CodeGen/ARM/thread_pointer.ll
+++ b/test/CodeGen/ARM/thread_pointer.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {__aeabi_read_tp}
+; RUN: grep "__aeabi_read_tp"
define i8* @test() {
entry:
diff --git a/test/CodeGen/ARM/thumb2-it-block.ll b/test/CodeGen/ARM/thumb2-it-block.ll
index 28fd469653..a25352c0f0 100644
--- a/test/CodeGen/ARM/thumb2-it-block.ll
+++ b/test/CodeGen/ARM/thumb2-it-block.ll
@@ -3,10 +3,10 @@
define i32 @test(i32 %a, i32 %b) {
entry:
-; CHECK: movs.w
+; CHECK: cmp
; CHECK-NEXT: it mi
; CHECK-NEXT: rsbmi
-; CHECK-NEXT: movs.w
+; CHECK-NEXT: cmp
; CHECK-NEXT: it mi
; CHECK-NEXT: rsbmi
%cmp1 = icmp slt i32 %a, 0
diff --git a/test/CodeGen/ARM/tls-models.ll b/test/CodeGen/ARM/tls-models.ll
new file mode 100644
index 0000000000..a5f3c9005a
--- /dev/null
+++ b/test/CodeGen/ARM/tls-models.ll
@@ -0,0 +1,117 @@
+; RUN: llc -march=arm -mtriple=arm-linux-gnueabi < %s | FileCheck -check-prefix=CHECK-NONPIC %s
+; RUN: llc -march=arm -mtriple=arm-linux-gnueabi -relocation-model=pic < %s | FileCheck -check-prefix=CHECK-PIC %s
+
+
+@external_gd = external thread_local global i32
+@internal_gd = internal thread_local global i32 42
+
+@external_ld = external thread_local(localdynamic) global i32
+@internal_ld = internal thread_local(localdynamic) global i32 42
+
+@external_ie = external thread_local(initialexec) global i32
+@internal_ie = internal thread_local(initialexec) global i32 42
+
+@external_le = external thread_local(localexec) global i32
+@internal_le = internal thread_local(localexec) global i32 42
+
+; ----- no model specified -----
+
+define i32* @f1() {
+entry:
+ ret i32* @external_gd
+
+ ; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
+ ; CHECK-NONPIC: f1:
+ ; CHECK-NONPIC: external_gd(gottpoff)
+ ; CHECK-PIC: f1:
+ ; CHECK-PIC: external_gd(tlsgd)
+}
+
+define i32* @f2() {
+entry:
+ ret i32* @internal_gd
+
+ ; Non-PIC code can use local exec, PIC code can use local dynamic,
+ ; but that is not implemented, so falls back to general dynamic.
+ ; CHECK-NONPIC: f2:
+ ; CHECK-NONPIC: internal_gd(tpoff)
+ ; CHECK-PIC: f2:
+ ; CHECK-PIC: internal_gd(tlsgd)
+}
+
+
+; ----- localdynamic specified -----
+
+define i32* @f3() {
+entry:
+ ret i32* @external_ld
+
+ ; Non-PIC code can use initial exec, PIC should use local dynamic,
+ ; but that is not implemented, so falls back to general dynamic.
+ ; CHECK-NONPIC: f3:
+ ; CHECK-NONPIC: external_ld(gottpoff)
+ ; CHECK-PIC: f3:
+ ; CHECK-PIC: external_ld(tlsgd)
+}
+
+define i32* @f4() {
+entry:
+ ret i32* @internal_ld
+
+ ; Non-PIC code can use local exec, PIC code can use local dynamic,
+ ; but that is not implemented, so it falls back to general dynamic.
+ ; CHECK-NONPIC: f4:
+ ; CHECK-NONPIC: internal_ld(tpoff)
+ ; CHECK-PIC: f4:
+ ; CHECK-PIC: internal_ld(tlsgd)
+}
+
+
+; ----- initialexec specified -----
+
+define i32* @f5() {
+entry:
+ ret i32* @external_ie
+
+ ; Non-PIC and PIC code will use initial exec as specified.
+ ; CHECK-NONPIC: f5:
+ ; CHECK-NONPIC: external_ie(gottpoff)
+ ; CHECK-PIC: f5:
+ ; CHECK-PIC: external_ie(gottpoff)
+}
+
+define i32* @f6() {
+entry:
+ ret i32* @internal_ie
+
+ ; Non-PIC code can use local exec, PIC code use initial exec as specified.
+ ; CHECK-NONPIC: f6:
+ ; CHECK-NONPIC: internal_ie(tpoff)
+ ; CHECK-PIC: f6:
+ ; CHECK-PIC: internal_ie(gottpoff)
+}
+
+
+; ----- localexec specified -----
+
+define i32* @f7() {
+entry:
+ ret i32* @external_le
+
+ ; Non-PIC and PIC code will use local exec as specified.
+ ; CHECK-NONPIC: f7:
+ ; CHECK-NONPIC: external_le(tpoff)
+ ; CHECK-PIC: f7:
+ ; CHECK-PIC: external_le(tpoff)
+}
+
+define i32* @f8() {
+entry:
+ ret i32* @internal_le
+
+ ; Non-PIC and PIC code will use local exec as specified.
+ ; CHECK-NONPIC: f8:
+ ; CHECK-NONPIC: internal_le(tpoff)
+ ; CHECK-PIC: f8:
+ ; CHECK-PIC: internal_le(tpoff)
+}
diff --git a/test/CodeGen/ARM/tls1.ll b/test/CodeGen/ARM/tls1.ll
index 1087094e57..ec4278ce72 100644
--- a/test/CodeGen/ARM/tls1.ll
+++ b/test/CodeGen/ARM/tls1.ll
@@ -1,9 +1,9 @@
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {i(tpoff)}
+; RUN: grep "i(tpoff)"
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {__aeabi_read_tp}
+; RUN: grep "__aeabi_read_tp"
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
-; RUN: -relocation-model=pic | grep {__tls_get_addr}
+; RUN: -relocation-model=pic | grep "__tls_get_addr"
@i = thread_local global i32 15 ; <i32*> [#uses=2]
diff --git a/test/CodeGen/ARM/tls3.ll b/test/CodeGen/ARM/tls3.ll
index df7a4ca02d..e0e944f70c 100644
--- a/test/CodeGen/ARM/tls3.ll
+++ b/test/CodeGen/ARM/tls3.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
-; RUN: grep {tbss}
+; RUN: grep "tbss"
%struct.anon = type { i32, i32 }
@teste = internal thread_local global %struct.anon zeroinitializer ; <%struct.anon*> [#uses=1]
diff --git a/test/CodeGen/CellSPU/icmp16.ll b/test/CodeGen/CellSPU/icmp16.ll
index 32b12617cf..2f9b091fae 100644
--- a/test/CodeGen/CellSPU/icmp16.ll
+++ b/test/CodeGen/CellSPU/icmp16.ll
@@ -1,14 +1,4 @@
-; RUN: llc < %s -march=cellspu > %t1.s
-; RUN: grep ilh %t1.s | count 15
-; RUN: grep ceqh %t1.s | count 29
-; RUN: grep ceqhi %t1.s | count 13
-; RUN: grep clgth %t1.s | count 15
-; RUN: grep cgth %t1.s | count 14
-; RUN: grep cgthi %t1.s | count 6
-; RUN: grep {selb\t\\\$3, \\\$6, \\\$5, \\\$3} %t1.s | count 7
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$6, \\\$3} %t1.s | count 3
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$4, \\\$3} %t1.s | count 17
-; RUN: grep {selb\t\\\$3, \\\$4, \\\$5, \\\$3} %t1.s | count 6
+; RUN: llc < %s -march=cellspu | FileCheck %s
target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
target triple = "spu"
@@ -27,6 +17,10 @@ target triple = "spu"
; i16 integer comparisons:
define i16 @icmp_eq_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_eq_select_i16:
+; CHECK: ceqh
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp eq i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -34,12 +28,22 @@ entry:
}
define i1 @icmp_eq_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_eq_setcc_i16:
+; CHECK: ilhu
+; CHECK: ceqh
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp eq i16 %arg1, %arg2
ret i1 %A
}
define i16 @icmp_eq_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_eq_immed01_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i16 %arg1, 511
%B = select i1 %A, i16 %val1, i16 %val2
@@ -47,6 +51,10 @@ entry:
}
define i16 @icmp_eq_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_eq_immed02_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i16 %arg1, -512
%B = select i1 %A, i16 %val1, i16 %val2
@@ -54,6 +62,10 @@ entry:
}
define i16 @icmp_eq_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_eq_immed03_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i16 %arg1, -1
%B = select i1 %A, i16 %val1, i16 %val2
@@ -61,6 +73,11 @@ entry:
}
define i16 @icmp_eq_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_eq_immed04_i16:
+; CHECK: ilh
+; CHECK: ceqh
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i16 %arg1, 32768
%B = select i1 %A, i16 %val1, i16 %val2
@@ -68,6 +85,10 @@ entry:
}
define i16 @icmp_ne_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ne_select_i16:
+; CHECK: ceqh
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp ne i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -75,12 +96,23 @@ entry:
}
define i1 @icmp_ne_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ne_setcc_i16:
+; CHECK: ceqh
+; CHECK: ilhu
+; CHECK: xorhi
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ne i16 %arg1, %arg2
ret i1 %A
}
define i16 @icmp_ne_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ne_immed01_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i16 %arg1, 511
%B = select i1 %A, i16 %val1, i16 %val2
@@ -88,6 +120,10 @@ entry:
}
define i16 @icmp_ne_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ne_immed02_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i16 %arg1, -512
%B = select i1 %A, i16 %val1, i16 %val2
@@ -95,6 +131,10 @@ entry:
}
define i16 @icmp_ne_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ne_immed03_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i16 %arg1, -1
%B = select i1 %A, i16 %val1, i16 %val2
@@ -102,6 +142,11 @@ entry:
}
define i16 @icmp_ne_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ne_immed04_i16:
+; CHECK: ilh
+; CHECK: ceqh
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i16 %arg1, 32768
%B = select i1 %A, i16 %val1, i16 %val2
@@ -109,6 +154,10 @@ entry:
}
define i16 @icmp_ugt_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ugt_select_i16:
+; CHECK: clgth
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp ugt i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -116,12 +165,22 @@ entry:
}
define i1 @icmp_ugt_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ugt_setcc_i16:
+; CHECK: ilhu
+; CHECK: clgth
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ugt i16 %arg1, %arg2
ret i1 %A
}
define i16 @icmp_ugt_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ugt_immed01_i16:
+; CHECK: clgthi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i16 %arg1, 500
%B = select i1 %A, i16 %val1, i16 %val2
@@ -129,6 +188,10 @@ entry:
}
define i16 @icmp_ugt_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ugt_immed02_i16:
+; CHECK: ceqhi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ugt i16 %arg1, 0
%B = select i1 %A, i16 %val1, i16 %val2
@@ -136,6 +199,10 @@ entry:
}
define i16 @icmp_ugt_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ugt_immed03_i16:
+; CHECK: clgthi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i16 %arg1, 65024
%B = select i1 %A, i16 %val1, i16 %val2
@@ -143,6 +210,11 @@ entry:
}
define i16 @icmp_ugt_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ugt_immed04_i16:
+; CHECK: ilh
+; CHECK: clgth
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i16 %arg1, 32768
%B = select i1 %A, i16 %val1, i16 %val2
@@ -150,6 +222,12 @@ entry:
}
define i16 @icmp_uge_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_uge_select_i16:
+; CHECK: ceqh
+; CHECK: clgth
+; CHECK: or
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp uge i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -157,6 +235,14 @@ entry:
}
define i1 @icmp_uge_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_uge_setcc_i16:
+; CHECK: ceqh
+; CHECK: clgth
+; CHECK: ilhu
+; CHECK: or
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp uge i16 %arg1, %arg2
ret i1 %A
@@ -169,6 +255,12 @@ entry:
;; they'll ever be generated.
define i16 @icmp_ult_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ult_select_i16:
+; CHECK: ceqh
+; CHECK: clgth
+; CHECK: nor
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp ult i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -176,12 +268,26 @@ entry:
}
define i1 @icmp_ult_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ult_setcc_i16:
+; CHECK: ceqh
+; CHECK: clgth
+; CHECK: ilhu
+; CHECK: nor
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ult i16 %arg1, %arg2
ret i1 %A
}
define i16 @icmp_ult_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ult_immed01_i16:
+; CHECK: ceqhi
+; CHECK: clgthi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i16 %arg1, 511
%B = select i1 %A, i16 %val1, i16 %val2
@@ -189,6 +295,12 @@ entry:
}
define i16 @icmp_ult_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ult_immed02_i16:
+; CHECK: ceqhi
+; CHECK: clgthi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i16 %arg1, 65534
%B = select i1 %A, i16 %val1, i16 %val2
@@ -196,6 +308,12 @@ entry:
}
define i16 @icmp_ult_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ult_immed03_i16:
+; CHECK: ceqhi
+; CHECK: clgthi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i16 %arg1, 65024
%B = select i1 %A, i16 %val1, i16 %val2
@@ -203,6 +321,13 @@ entry:
}
define i16 @icmp_ult_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ult_immed04_i16:
+; CHECK: ilh
+; CHECK: ceqh
+; CHECK: clgth
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i16 %arg1, 32769
%B = select i1 %A, i16 %val1, i16 %val2
@@ -210,6 +335,10 @@ entry:
}
define i16 @icmp_ule_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ule_select_i16:
+; CHECK: clgth
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp ule i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -217,6 +346,13 @@ entry:
}
define i1 @icmp_ule_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_ule_setcc_i16:
+; CHECK: clgth
+; CHECK: ilhu
+; CHECK: xorhi
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ule i16 %arg1, %arg2
ret i1 %A
@@ -229,6 +365,10 @@ entry:
;; they'll ever be generated.
define i16 @icmp_sgt_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sgt_select_i16:
+; CHECK: cgth
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp sgt i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -236,12 +376,22 @@ entry:
}
define i1 @icmp_sgt_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sgt_setcc_i16:
+; CHECK: ilhu
+; CHECK: cgth
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp sgt i16 %arg1, %arg2
ret i1 %A
}
define i16 @icmp_sgt_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sgt_immed01_i16:
+; CHECK: cgthi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i16 %arg1, 511
%B = select i1 %A, i16 %val1, i16 %val2
@@ -249,6 +399,10 @@ entry:
}
define i16 @icmp_sgt_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sgt_immed02_i16:
+; CHECK: cgthi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i16 %arg1, -1
%B = select i1 %A, i16 %val1, i16 %val2
@@ -256,6 +410,10 @@ entry:
}
define i16 @icmp_sgt_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sgt_immed03_i16:
+; CHECK: cgthi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i16 %arg1, -512
%B = select i1 %A, i16 %val1, i16 %val2
@@ -263,6 +421,11 @@ entry:
}
define i16 @icmp_sgt_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sgt_immed04_i16:
+; CHECK: ilh
+; CHECK: ceqh
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp sgt i16 %arg1, 32768
%B = select i1 %A, i16 %val1, i16 %val2
@@ -270,6 +433,12 @@ entry:
}
define i16 @icmp_sge_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sge_select_i16:
+; CHECK: ceqh
+; CHECK: cgth
+; CHECK: or
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp sge i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -277,6 +446,14 @@ entry:
}
define i1 @icmp_sge_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sge_setcc_i16:
+; CHECK: ceqh
+; CHECK: cgth
+; CHECK: ilhu
+; CHECK: or
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp sge i16 %arg1, %arg2
ret i1 %A
@@ -289,6 +466,12 @@ entry:
;; they'll ever be generated.
define i16 @icmp_slt_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_slt_select_i16:
+; CHECK: ceqh
+; CHECK: cgth
+; CHECK: nor
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp slt i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -296,12 +479,26 @@ entry:
}
define i1 @icmp_slt_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_slt_setcc_i16:
+; CHECK: ceqh
+; CHECK: cgth
+; CHECK: ilhu
+; CHECK: nor
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp slt i16 %arg1, %arg2
ret i1 %A
}
define i16 @icmp_slt_immed01_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_slt_immed01_i16:
+; CHECK: ceqhi
+; CHECK: cgthi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i16 %arg1, 511
%B = select i1 %A, i16 %val1, i16 %val2
@@ -309,6 +506,12 @@ entry:
}
define i16 @icmp_slt_immed02_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_slt_immed02_i16:
+; CHECK: ceqhi
+; CHECK: cgthi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i16 %arg1, -512
%B = select i1 %A, i16 %val1, i16 %val2
@@ -316,6 +519,12 @@ entry:
}
define i16 @icmp_slt_immed03_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_slt_immed03_i16:
+; CHECK: ceqhi
+; CHECK: cgthi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i16 %arg1, -1
%B = select i1 %A, i16 %val1, i16 %val2
@@ -323,6 +532,10 @@ entry:
}
define i16 @icmp_slt_immed04_i16(i16 %arg1, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_slt_immed04_i16:
+; CHECK: lr
+; CHECK-NETX: bi
+
entry:
%A = icmp slt i16 %arg1, 32768
%B = select i1 %A, i16 %val1, i16 %val2
@@ -330,6 +543,10 @@ entry:
}
define i16 @icmp_sle_select_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sle_select_i16:
+; CHECK: cgth
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp sle i16 %arg1, %arg2
%B = select i1 %A, i16 %val1, i16 %val2
@@ -337,6 +554,13 @@ entry:
}
define i1 @icmp_sle_setcc_i16(i16 %arg1, i16 %arg2, i16 %val1, i16 %val2) nounwind {
+; CHECK: icmp_sle_setcc_i16:
+; CHECK: cgth
+; CHECK: ilhu
+; CHECK: xorhi
+; CHECK: iohl
+; CHECK-NETX: bi
+
entry:
%A = icmp sle i16 %arg1, %arg2
ret i1 %A
diff --git a/test/CodeGen/CellSPU/icmp32.ll b/test/CodeGen/CellSPU/icmp32.ll
index ccbb5f7cde..ea912847e8 100644
--- a/test/CodeGen/CellSPU/icmp32.ll
+++ b/test/CodeGen/CellSPU/icmp32.ll
@@ -1,14 +1,4 @@
-; RUN: llc < %s -march=cellspu > %t1.s
-; RUN: grep ila %t1.s | count 6
-; RUN: grep ceq %t1.s | count 28
-; RUN: grep ceqi %t1.s | count 12
-; RUN: grep clgt %t1.s | count 16
-; RUN: grep clgti %t1.s | count 6
-; RUN: grep cgt %t1.s | count 16
-; RUN: grep cgti %t1.s | count 6
-; RUN: grep {selb\t\\\$3, \\\$6, \\\$5, \\\$3} %t1.s | count 7
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$6, \\\$3} %t1.s | count 3
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$4, \\\$3} %t1.s | count 20
+; RUN: llc < %s -march=cellspu | FileCheck %s
target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
target triple = "spu"
@@ -27,6 +17,10 @@ target triple = "spu"
; i32 integer comparisons:
define i32 @icmp_eq_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_eq_select_i32:
+; CHECK: ceq
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp eq i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -34,12 +28,22 @@ entry:
}
define i1 @icmp_eq_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_eq_setcc_i32:
+; CHECK: ilhu
+; CHECK: ceq
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp eq i32 %arg1, %arg2
ret i1 %A
}
define i32 @icmp_eq_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_eq_immed01_i32:
+; CHECK: ceqi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i32 %arg1, 511
%B = select i1 %A, i32 %val1, i32 %val2
@@ -47,6 +51,10 @@ entry:
}
define i32 @icmp_eq_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_eq_immed02_i32:
+; CHECK: ceqi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i32 %arg1, -512
%B = select i1 %A, i32 %val1, i32 %val2
@@ -54,6 +62,10 @@ entry:
}
define i32 @icmp_eq_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_eq_immed03_i32:
+; CHECK: ceqi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i32 %arg1, -1
%B = select i1 %A, i32 %val1, i32 %val2
@@ -61,6 +73,11 @@ entry:
}
define i32 @icmp_eq_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_eq_immed04_i32:
+; CHECK: ila
+; CHECK: ceq
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i32 %arg1, 32768
%B = select i1 %A, i32 %val1, i32 %val2
@@ -68,6 +85,10 @@ entry:
}
define i32 @icmp_ne_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ne_select_i32:
+; CHECK: ceq
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp ne i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -75,12 +96,23 @@ entry:
}
define i1 @icmp_ne_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ne_setcc_i32:
+; CHECK: ceq
+; CHECK: ilhu
+; CHECK: xori
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ne i32 %arg1, %arg2
ret i1 %A
}
define i32 @icmp_ne_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ne_immed01_i32:
+; CHECK: ceqi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i32 %arg1, 511
%B = select i1 %A, i32 %val1, i32 %val2
@@ -88,6 +120,10 @@ entry:
}
define i32 @icmp_ne_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ne_immed02_i32:
+; CHECK: ceqi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i32 %arg1, -512
%B = select i1 %A, i32 %val1, i32 %val2
@@ -95,6 +131,10 @@ entry:
}
define i32 @icmp_ne_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ne_immed03_i32:
+; CHECK: ceqi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i32 %arg1, -1
%B = select i1 %A, i32 %val1, i32 %val2
@@ -102,6 +142,11 @@ entry:
}
define i32 @icmp_ne_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ne_immed04_i32:
+; CHECK: ila
+; CHECK: ceq
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i32 %arg1, 32768
%B = select i1 %A, i32 %val1, i32 %val2
@@ -109,6 +154,10 @@ entry:
}
define i32 @icmp_ugt_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ugt_select_i32:
+; CHECK: clgt
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp ugt i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -116,12 +165,22 @@ entry:
}
define i1 @icmp_ugt_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ugt_setcc_i32:
+; CHECK: ilhu
+; CHECK: clgt
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ugt i32 %arg1, %arg2
ret i1 %A
}
define i32 @icmp_ugt_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ugt_immed01_i32:
+; CHECK: clgti
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i32 %arg1, 511
%B = select i1 %A, i32 %val1, i32 %val2
@@ -129,6 +188,10 @@ entry:
}
define i32 @icmp_ugt_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ugt_immed02_i32:
+; CHECK: clgti
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i32 %arg1, 4294966784
%B = select i1 %A, i32 %val1, i32 %val2
@@ -136,6 +199,10 @@ entry:
}
define i32 @icmp_ugt_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ugt_immed03_i32:
+; CHECK: clgti
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i32 %arg1, 4294967293
%B = select i1 %A, i32 %val1, i32 %val2
@@ -143,6 +210,11 @@ entry:
}
define i32 @icmp_ugt_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ugt_immed04_i32:
+; CHECK: ila
+; CHECK: clgt
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i32 %arg1, 32768
%B = select i1 %A, i32 %val1, i32 %val2
@@ -150,6 +222,12 @@ entry:
}
define i32 @icmp_uge_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_uge_select_i32:
+; CHECK: ceq
+; CHECK: clgt
+; CHECK: or
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp uge i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -157,6 +235,14 @@ entry:
}
define i1 @icmp_uge_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_uge_setcc_i32:
+; CHECK: ceq
+; CHECK: clgt
+; CHECK: ilhu
+; CHECK: or
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp uge i32 %arg1, %arg2
ret i1 %A
@@ -169,6 +255,12 @@ entry:
;; they'll ever be generated.
define i32 @icmp_ult_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ult_select_i32:
+; CHECK: ceq
+; CHECK: clgt
+; CHECK: nor
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp ult i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -176,12 +268,26 @@ entry:
}
define i1 @icmp_ult_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ult_setcc_i32:
+; CHECK: ceq
+; CHECK: clgt
+; CHECK: ilhu
+; CHECK: nor
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ult i32 %arg1, %arg2
ret i1 %A
}
define i32 @icmp_ult_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ult_immed01_i32:
+; CHECK: ceqi
+; CHECK: clgti
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i32 %arg1, 511
%B = select i1 %A, i32 %val1, i32 %val2
@@ -189,6 +295,12 @@ entry:
}
define i32 @icmp_ult_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ult_immed02_i32:
+; CHECK: ceqi
+; CHECK: clgti
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i32 %arg1, 4294966784
%B = select i1 %A, i32 %val1, i32 %val2
@@ -196,6 +308,12 @@ entry:
}
define i32 @icmp_ult_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ult_immed03_i32:
+; CHECK: ceqi
+; CHECK: clgti
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i32 %arg1, 4294967293
%B = select i1 %A, i32 %val1, i32 %val2
@@ -203,6 +321,13 @@ entry:
}
define i32 @icmp_ult_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ult_immed04_i32:
+; CHECK: ila
+; CHECK: ceq
+; CHECK: clgt
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i32 %arg1, 32768
%B = select i1 %A, i32 %val1, i32 %val2
@@ -210,6 +335,10 @@ entry:
}
define i32 @icmp_ule_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ule_select_i32:
+; CHECK: clgt
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp ule i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -217,6 +346,13 @@ entry:
}
define i1 @icmp_ule_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_ule_setcc_i32:
+; CHECK: clgt
+; CHECK: ilhu
+; CHECK: xori
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp ule i32 %arg1, %arg2
ret i1 %A
@@ -229,6 +365,10 @@ entry:
;; they'll ever be generated.
define i32 @icmp_sgt_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sgt_select_i32:
+; CHECK: cgt
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp sgt i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -236,12 +376,22 @@ entry:
}
define i1 @icmp_sgt_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sgt_setcc_i32:
+; CHECK: ilhu
+; CHECK: cgt
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp sgt i32 %arg1, %arg2
ret i1 %A
}
define i32 @icmp_sgt_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sgt_immed01_i32:
+; CHECK: cgti
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i32 %arg1, 511
%B = select i1 %A, i32 %val1, i32 %val2
@@ -249,6 +399,10 @@ entry:
}
define i32 @icmp_sgt_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sgt_immed02_i32:
+; CHECK: cgti
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i32 %arg1, 4294966784
%B = select i1 %A, i32 %val1, i32 %val2
@@ -256,6 +410,10 @@ entry:
}
define i32 @icmp_sgt_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sgt_immed03_i32:
+; CHECK: cgti
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i32 %arg1, 4294967293
%B = select i1 %A, i32 %val1, i32 %val2
@@ -263,6 +421,11 @@ entry:
}
define i32 @icmp_sgt_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sgt_immed04_i32:
+; CHECK: ila
+; CHECK: cgt
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i32 %arg1, 32768
%B = select i1 %A, i32 %val1, i32 %val2
@@ -270,6 +433,12 @@ entry:
}
define i32 @icmp_sge_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sge_select_i32:
+; CHECK: ceq
+; CHECK: cgt
+; CHECK: or
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp sge i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -277,6 +446,14 @@ entry:
}
define i1 @icmp_sge_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sge_setcc_i32:
+; CHECK: ceq
+; CHECK: cgt
+; CHECK: ilhu
+; CHECK: or
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp sge i32 %arg1, %arg2
ret i1 %A
@@ -289,6 +466,12 @@ entry:
;; they'll ever be generated.
define i32 @icmp_slt_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_slt_select_i32:
+; CHECK: ceq
+; CHECK: cgt
+; CHECK: nor
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp slt i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -296,12 +479,26 @@ entry:
}
define i1 @icmp_slt_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_slt_setcc_i32:
+; CHECK: ceq
+; CHECK: cgt
+; CHECK: ilhu
+; CHECK: nor
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp slt i32 %arg1, %arg2
ret i1 %A
}
define i32 @icmp_slt_immed01_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_slt_immed01_i32:
+; CHECK: ceqi
+; CHECK: cgti
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i32 %arg1, 511
%B = select i1 %A, i32 %val1, i32 %val2
@@ -309,6 +506,12 @@ entry:
}
define i32 @icmp_slt_immed02_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_slt_immed02_i32:
+; CHECK: ceqi
+; CHECK: cgti
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i32 %arg1, -512
%B = select i1 %A, i32 %val1, i32 %val2
@@ -316,6 +519,12 @@ entry:
}
define i32 @icmp_slt_immed03_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_slt_immed03_i32:
+; CHECK: ceqi
+; CHECK: cgti
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i32 %arg1, -1
%B = select i1 %A, i32 %val1, i32 %val2
@@ -323,6 +532,13 @@ entry:
}
define i32 @icmp_slt_immed04_i32(i32 %arg1, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_slt_immed04_i32:
+; CHECK: ila
+; CHECK: ceq
+; CHECK: cgt
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i32 %arg1, 32768
%B = select i1 %A, i32 %val1, i32 %val2
@@ -330,6 +546,10 @@ entry:
}
define i32 @icmp_sle_select_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sle_select_i32:
+; CHECK: cgt
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp sle i32 %arg1, %arg2
%B = select i1 %A, i32 %val1, i32 %val2
@@ -337,6 +557,13 @@ entry:
}
define i1 @icmp_sle_setcc_i32(i32 %arg1, i32 %arg2, i32 %val1, i32 %val2) nounwind {
+; CHECK: icmp_sle_setcc_i32:
+; CHECK: cgt
+; CHECK: ilhu
+; CHECK: xori
+; CHECK: iohl
+; CHECK: shufb
+
entry:
%A = icmp sle i32 %arg1, %arg2
ret i1 %A
diff --git a/test/CodeGen/CellSPU/icmp8.ll b/test/CodeGen/CellSPU/icmp8.ll
index 5517d104ab..1db641e5a8 100644
--- a/test/CodeGen/CellSPU/icmp8.ll
+++ b/test/CodeGen/CellSPU/icmp8.ll
@@ -1,13 +1,4 @@
-; RUN: llc < %s -march=cellspu > %t1.s
-; RUN: grep ceqb %t1.s | count 24
-; RUN: grep ceqbi %t1.s | count 12
-; RUN: grep clgtb %t1.s | count 11
-; RUN: grep cgtb %t1.s | count 13
-; RUN: grep cgtbi %t1.s | count 5
-; RUN: grep {selb\t\\\$3, \\\$6, \\\$5, \\\$3} %t1.s | count 7
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$6, \\\$3} %t1.s | count 3
-; RUN: grep {selb\t\\\$3, \\\$5, \\\$4, \\\$3} %t1.s | count 11
-; RUN: grep {selb\t\\\$3, \\\$4, \\\$5, \\\$3} %t1.s | count 4
+; RUN: llc < %s -march=cellspu | FileCheck %s
target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
target triple = "spu"
@@ -26,6 +17,10 @@ target triple = "spu"
; i8 integer comparisons:
define i8 @icmp_eq_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_eq_select_i8:
+; CHECK: ceqb
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp eq i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -33,12 +28,20 @@ entry:
}
define i1 @icmp_eq_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_eq_setcc_i8:
+; CHECK: ceqb
+; CHECK-NEXT: bi
+
entry:
%A = icmp eq i8 %arg1, %arg2
ret i1 %A
}
define i8 @icmp_eq_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_eq_immed01_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i8 %arg1, 127
%B = select i1 %A, i8 %val1, i8 %val2
@@ -46,6 +49,10 @@ entry:
}
define i8 @icmp_eq_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_eq_immed02_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i8 %arg1, -128
%B = select i1 %A, i8 %val1, i8 %val2
@@ -53,6 +60,10 @@ entry:
}
define i8 @icmp_eq_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_eq_immed03_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp eq i8 %arg1, -1
%B = select i1 %A, i8 %val1, i8 %val2
@@ -60,6 +71,10 @@ entry:
}
define i8 @icmp_ne_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ne_select_i8:
+; CHECK: ceqb
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp ne i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -67,12 +82,21 @@ entry:
}
define i1 @icmp_ne_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ne_setcc_i8:
+; CHECK: ceqb
+; CHECK: xorbi
+; CHECK-NEXT: bi
+
entry:
%A = icmp ne i8 %arg1, %arg2
ret i1 %A
}
define i8 @icmp_ne_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ne_immed01_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i8 %arg1, 127
%B = select i1 %A, i8 %val1, i8 %val2
@@ -80,6 +104,10 @@ entry:
}
define i8 @icmp_ne_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ne_immed02_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i8 %arg1, -128
%B = select i1 %A, i8 %val1, i8 %val2
@@ -87,6 +115,10 @@ entry:
}
define i8 @icmp_ne_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ne_immed03_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp ne i8 %arg1, -1
%B = select i1 %A, i8 %val1, i8 %val2
@@ -94,6 +126,10 @@ entry:
}
define i8 @icmp_ugt_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ugt_select_i8:
+; CHECK: clgtb
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp ugt i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -101,12 +137,20 @@ entry:
}
define i1 @icmp_ugt_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ugt_setcc_i8:
+; CHECK: clgtb
+; CHECK-NEXT: bi
+
entry:
%A = icmp ugt i8 %arg1, %arg2
ret i1 %A
}
define i8 @icmp_ugt_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ugt_immed01_i8:
+; CHECK: clgtbi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ugt i8 %arg1, 126
%B = select i1 %A, i8 %val1, i8 %val2
@@ -114,6 +158,12 @@ entry:
}
define i8 @icmp_uge_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_uge_select_i8:
+; CHECK: ceqb
+; CHECK: clgtb
+; CHECK: or
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp uge i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -121,6 +171,12 @@ entry:
}
define i1 @icmp_uge_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_uge_setcc_i8:
+; CHECK: ceqb
+; CHECK: clgtb
+; CHECK: or
+; CHECK-NEXT: bi
+
entry:
%A = icmp uge i8 %arg1, %arg2
ret i1 %A
@@ -133,6 +189,12 @@ entry:
;; they'll ever be generated.
define i8 @icmp_ult_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ult_select_i8:
+; CHECK: ceqb
+; CHECK: clgtb
+; CHECK: nor
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp ult i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -140,12 +202,24 @@ entry:
}
define i1 @icmp_ult_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ult_setcc_i8:
+; CHECK: ceqb
+; CHECK: clgtb
+; CHECK: nor
+; CHECK-NEXT: bi
+
entry:
%A = icmp ult i8 %arg1, %arg2
ret i1 %A
}
define i8 @icmp_ult_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ult_immed01_i8:
+; CHECK: ceqbi
+; CHECK: clgtbi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i8 %arg1, 253
%B = select i1 %A, i8 %val1, i8 %val2
@@ -153,6 +227,12 @@ entry:
}
define i8 @icmp_ult_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ult_immed02_i8:
+; CHECK: ceqbi
+; CHECK: clgtbi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp ult i8 %arg1, 129
%B = select i1 %A, i8 %val1, i8 %val2
@@ -160,6 +240,10 @@ entry:
}
define i8 @icmp_ule_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ule_select_i8:
+; CHECK: clgtb
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp ule i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -167,6 +251,11 @@ entry:
}
define i1 @icmp_ule_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_ule_setcc_i8:
+; CHECK: clgtb
+; CHECK: xorbi
+; CHECK-NEXT: bi
+
entry:
%A = icmp ule i8 %arg1, %arg2
ret i1 %A
@@ -179,6 +268,10 @@ entry:
;; they'll ever be generated.
define i8 @icmp_sgt_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sgt_select_i8:
+; CHECK: cgtb
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp sgt i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -186,12 +279,20 @@ entry:
}
define i1 @icmp_sgt_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sgt_setcc_i8:
+; CHECK: cgtb
+; CHECK-NEXT: bi
+
entry:
%A = icmp sgt i8 %arg1, %arg2
ret i1 %A
}
define i8 @icmp_sgt_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sgt_immed01_i8:
+; CHECK: cgtbi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i8 %arg1, 96
%B = select i1 %A, i8 %val1, i8 %val2
@@ -199,6 +300,10 @@ entry:
}
define i8 @icmp_sgt_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sgt_immed02_i8:
+; CHECK: cgtbi
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp sgt i8 %arg1, -1
%B = select i1 %A, i8 %val1, i8 %val2
@@ -206,6 +311,10 @@ entry:
}
define i8 @icmp_sgt_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sgt_immed03_i8:
+; CHECK: ceqbi
+; CHECK: selb $3, $4, $5, $3
+
entry:
%A = icmp sgt i8 %arg1, -128
%B = select i1 %A, i8 %val1, i8 %val2
@@ -213,6 +322,12 @@ entry:
}
define i8 @icmp_sge_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sge_select_i8:
+; CHECK: ceqb
+; CHECK: cgtb
+; CHECK: or
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp sge i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -220,6 +335,12 @@ entry:
}
define i1 @icmp_sge_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sge_setcc_i8:
+; CHECK: ceqb
+; CHECK: cgtb
+; CHECK: or
+; CHECK-NEXT: bi
+
entry:
%A = icmp sge i8 %arg1, %arg2
ret i1 %A
@@ -232,6 +353,12 @@ entry:
;; they'll ever be generated.
define i8 @icmp_slt_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_slt_select_i8:
+; CHECK: ceqb
+; CHECK: cgtb
+; CHECK: nor
+; CHECK: selb $3, $6, $5, $3
+
entry:
%A = icmp slt i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -239,12 +366,24 @@ entry:
}
define i1 @icmp_slt_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_slt_setcc_i8:
+; CHECK: ceqb
+; CHECK: cgtb
+; CHECK: nor
+; CHECK-NEXT: bi
+
entry:
%A = icmp slt i8 %arg1, %arg2
ret i1 %A
}
define i8 @icmp_slt_immed01_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_slt_immed01_i8:
+; CHECK: ceqbi
+; CHECK: cgtbi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i8 %arg1, 96
%B = select i1 %A, i8 %val1, i8 %val2
@@ -252,6 +391,12 @@ entry:
}
define i8 @icmp_slt_immed02_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_slt_immed02_i8:
+; CHECK: ceqbi
+; CHECK: cgtbi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i8 %arg1, -120
%B = select i1 %A, i8 %val1, i8 %val2
@@ -259,6 +404,12 @@ entry:
}
define i8 @icmp_slt_immed03_i8(i8 %arg1, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_slt_immed03_i8:
+; CHECK: ceqbi
+; CHECK: cgtbi
+; CHECK: nor
+; CHECK: selb $3, $5, $4, $3
+
entry:
%A = icmp slt i8 %arg1, -1
%B = select i1 %A, i8 %val1, i8 %val2
@@ -266,6 +417,10 @@ entry:
}
define i8 @icmp_sle_select_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sle_select_i8:
+; CHECK: cgtb
+; CHECK: selb $3, $5, $6, $3
+
entry:
%A = icmp sle i8 %arg1, %arg2
%B = select i1 %A, i8 %val1, i8 %val2
@@ -273,6 +428,11 @@ entry:
}
define i1 @icmp_sle_setcc_i8(i8 %arg1, i8 %arg2, i8 %val1, i8 %val2) nounwind {
+; CHECK: icmp_sle_setcc_i8:
+; CHECK: cgtb
+; CHECK: xorbi
+; CHECK-NEXT: bi
+
entry:
%A = icmp sle i8 %arg1, %arg2
ret i1 %A
diff --git a/test/CodeGen/CellSPU/shift_ops.ll b/test/CodeGen/CellSPU/shift_ops.ll
index f4aad44ed6..1ccc356dcf 100644
--- a/test/CodeGen/CellSPU/shift_ops.ll
+++ b/test/CodeGen/CellSPU/shift_ops.ll
@@ -1,20 +1,20 @@
; RUN: llc < %s -march=cellspu > %t1.s
-; RUN: grep {shlh } %t1.s | count 10
-; RUN: grep {shlhi } %t1.s | count 3
-; RUN: grep {shl } %t1.s | count 10
-; RUN: grep {shli } %t1.s | count 3
-; RUN: grep {xshw } %t1.s | count 5
-; RUN: grep {and } %t1.s | count 15
-; RUN: grep {andi } %t1.s | count 4
-; RUN: grep {rotmi } %t1.s | count 4
-; RUN: grep {rotqmbyi } %t1.s | count 1
-; RUN: grep {rotqmbii } %t1.s | count 2
-; RUN: grep {rotqmby } %t1.s | count 1
-; RUN: grep {rotqmbi } %t1.s | count 2
-; RUN: grep {rotqbyi } %t1.s | count 1
-; RUN: grep {rotqbii } %t1.s | count 2
-; RUN: grep {rotqbybi } %t1.s | count 1
-; RUN: grep {sfi } %t1.s | count 6
+; RUN: grep "shlh " %t1.s | count 10
+; RUN: grep "shlhi " %t1.s | count 3
+; RUN: grep "shl " %t1.s | count 10
+; RUN: grep "shli " %t1.s | count 3
+; RUN: grep "xshw " %t1.s | count 5
+; RUN: grep "and " %t1.s | count 15
+; RUN: grep "andi " %t1.s | count 4
+; RUN: grep "rotmi " %t1.s | count 4
+; RUN: grep "rotqmbyi " %t1.s | count 1
+; RUN: grep "rotqmbii " %t1.s | count 2
+; RUN: grep "rotqmby " %t1.s | count 1
+; RUN: grep "rotqmbi " %t1.s | count 2
+; RUN: grep "rotqbyi " %t1.s | count 1
+; RUN: grep "rotqbii " %t1.s | count 2
+; RUN: grep "rotqbybi " %t1.s | count 1
+; RUN: grep "sfi " %t1.s | count 6
; RUN: cat %t1.s | FileCheck %s
target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
diff --git a/test/CodeGen/CellSPU/stores.ll b/test/CodeGen/CellSPU/stores.ll
index 6ca5b08923..43f8776a3d 100644
--- a/test/CodeGen/CellSPU/stores.ll
+++ b/test/CodeGen/CellSPU/stores.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=cellspu > %t1.s
-; RUN: grep {stqd.*0(\$3)} %t1.s | count 4
-; RUN: grep {stqd.*16(\$3)} %t1.s | count 4
+; RUN: grep 'stqd.*0($3)' %t1.s | count 4
+; RUN: grep 'stqd.*16($3)' %t1.s | count 4
; RUN: grep 16256 %t1.s | count 2
; RUN: grep 16384 %t1.s | count 1
; RUN: grep 771 %t1.s | count 4
@@ -8,7 +8,7 @@
; RUN: grep 1799 %t1.s | count 2
; RUN: grep 1543 %t1.s | count 5
; RUN: grep 1029 %t1.s | count 3
-; RUN: grep {shli.*, 4} %t1.s | count 4
+; RUN: grep 'shli.*, 4' %t1.s | count 4
; RUN: grep stqx %t1.s | count 4
; RUN: grep ilhu %t1.s | count 11
; RUN: grep iohl %t1.s | count 8
diff --git a/test/CodeGen/CellSPU/trunc.ll b/test/CodeGen/CellSPU/trunc.ll
index d16185238a..e4c8fb49a3 100644
--- a/test/CodeGen/CellSPU/trunc.ll
+++ b/test/CodeGen/CellSPU/trunc.ll
@@ -1,19 +1,19 @@
; RUN: llc < %s -march=cellspu > %t1.s
; RUN: grep shufb %t1.s | count 19
-; RUN: grep {ilhu.*1799} %t1.s | count 1
-; RUN: grep {ilhu.*771} %t1.s | count 2
-; RUN: grep {ilhu.*1543} %t1.s | count 1
-; RUN: grep {ilhu.*1029} %t1.s | count 1
-; RUN: grep {ilhu.*515} %t1.s | count 1
-; RUN: grep {ilhu.*3855} %t1.s | count 1
-; RUN: grep {ilhu.*3599} %t1.s | count 1
-; RUN: grep {ilhu.*3085} %t1.s | count 1
-; RUN: grep {iohl.*3855} %t1.s | count 1
-; RUN: grep {iohl.*3599} %t1.s | count 2
-; RUN: grep {iohl.*1543} %t1.s | count 2
-; RUN: grep {iohl.*771} %t1.s | count 2
-; RUN: grep {iohl.*515} %t1.s | count 1
-; RUN: grep {iohl.*1799} %t1.s | count 1
+; RUN: grep "ilhu.*1799" %t1.s | count 1
+; RUN: grep "ilhu.*771" %t1.s | count 2
+; RUN: grep "ilhu.*1543" %t1.s | count 1
+; RUN: grep "ilhu.*1029" %t1.s | count 1
+; RUN: grep "ilhu.*515" %t1.s | count 1
+; RUN: grep "ilhu.*3855" %t1.s | count 1
+; RUN: grep "ilhu.*3599" %t1.s | count 1
+; RUN: grep "ilhu.*3085" %t1.s | count 1
+; RUN: grep "iohl.*3855" %t1.s | count 1
+; RUN: grep "iohl.*3599" %t1.s | count 2
+; RUN: grep "iohl.*1543" %t1.s | count 2
+; RUN: grep "iohl.*771" %t1.s | count 2
+; RUN: grep "iohl.*515" %t1.s | count 1
+; RUN: grep "iohl.*1799" %t1.s | count 1
; RUN: grep lqa %t1.s | count 1
; RUN: grep cbd %t1.s | count 4
; RUN: grep chd %t1.s | count 3
diff --git a/test/CodeGen/Generic/APIntLoadStore.ll b/test/CodeGen/Generic/APIntLoadStore.ll
index 2d71ece3eb..7c71a33fc3 100644
--- a/test/CodeGen/Generic/APIntLoadStore.ll
+++ b/test/CodeGen/Generic/APIntLoadStore.ll
@@ -1,5 +1,4 @@
; RUN: llc < %s > %t
-; XFAIL: powerpc
@i1_l = external global i1 ; <i1*> [#uses=1]
@i1_s = external global i1 ; <i1*> [#uses=1]
@i2_l = external global i2 ; <i2*> [#uses=1]
diff --git a/test/CodeGen/Generic/asm-large-immediate.ll b/test/CodeGen/Generic/asm-large-immediate.ll
index 605665bef6..891bbc9cc1 100644
--- a/test/CodeGen/Generic/asm-large-immediate.ll
+++ b/test/CodeGen/Generic/asm-large-immediate.ll
@@ -1,8 +1,10 @@
-; RUN: llc < %s | grep 68719476738
+; RUN: llc < %s | FileCheck %s
define void @test() {
entry:
+; CHECK: /* result: 68719476738 */
tail call void asm sideeffect "/* result: ${0:c} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
+; CHECK: /* result: -68719476738 */
+ tail call void asm sideeffect "/* result: ${0:n} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
ret void
}
-
diff --git a/test/CodeGen/Generic/donothing.ll b/test/CodeGen/Generic/donothing.ll
new file mode 100644
index 0000000000..d6ba138fc6
--- /dev/null
+++ b/test/CodeGen/Generic/donothing.ll
@@ -0,0 +1,31 @@
+; RUN: llc < %s | FileCheck %s
+
+declare i32 @__gxx_personality_v0(...)
+declare void @__cxa_call_unexpected(i8*)
+declare void @llvm.donothing() readnone
+
+; CHECK: f1
+define void @f1() nounwind uwtable ssp {
+entry:
+; CHECK-NOT donothing
+ invoke void @llvm.donothing()
+ to label %invoke.cont unwind label %lpad
+
+invoke.cont:
+ ret void
+
+lpad:
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ %1 = extractvalue { i8*, i32 } %0, 0
+ tail call void @__cxa_call_unexpected(i8* %1) noreturn nounwind
+ unreachable
+}
+
+; CHECK: f2
+define void @f2() nounwind {
+entry:
+; CHECK-NOT donothing
+ call void @llvm.donothing()
+ ret void
+}
diff --git a/test/CodeGen/Generic/print-after.ll b/test/CodeGen/Generic/print-after.ll
new file mode 100644
index 0000000000..7505907ef7
--- /dev/null
+++ b/test/CodeGen/Generic/print-after.ll
@@ -0,0 +1,6 @@
+; RUN: not llc --help-hidden 2>&1 | FileCheck %s
+
+; CHECK: -print-after
+; CHECK-NOT: -print-after-all
+; CHECK: =simple-register-coalescing
+; CHECK: -print-after-all
diff --git a/test/CodeGen/Generic/print-machineinstrs.ll b/test/CodeGen/Generic/print-machineinstrs.ll
index 75b4cd14ff..75dceb5b26 100644
--- a/test/CodeGen/Generic/print-machineinstrs.ll
+++ b/test/CodeGen/Generic/print-machineinstrs.ll
@@ -1,6 +1,6 @@
-; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs=branch-folder -o /dev/null |& FileCheck %s
-; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs -o /dev/null |& FileCheck %s
-; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null |& FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs=branch-folder -o /dev/null 2>&1 | FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs -o /dev/null 2>&1 | FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null 2>&1 | FileCheck %s
define i64 @foo(i64 %a, i64 %b) nounwind {
; CHECK: -branch-folder -print-machineinstrs
diff --git a/test/CodeGen/Generic/stop-after.ll b/test/CodeGen/Generic/stop-after.ll
new file mode 100644
index 0000000000..557e097840
--- /dev/null
+++ b/test/CodeGen/Generic/stop-after.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -debug-pass=Structure -stop-after=loop-reduce -o /dev/null 2>&1 | FileCheck %s -check-prefix=STOP
+; RUN: llc < %s -debug-pass=Structure -start-after=loop-reduce -o /dev/null 2>&1 | FileCheck %s -check-prefix=START
+
+; STOP: -loop-reduce -print-module
+; STOP: Loop Strength Reduction
+; STOP-NEXT: Machine Function Analysis
+
+; START: -machine-branch-prob -gc-lowering
+; START: FunctionPass Manager
+; START-NEXT: Lower Garbage Collection Instructions
diff --git a/test/CodeGen/Generic/undef-phi.ll b/test/CodeGen/Generic/undef-phi.ll
new file mode 100644
index 0000000000..10899f9fa2
--- /dev/null
+++ b/test/CodeGen/Generic/undef-phi.ll
@@ -0,0 +1,26 @@
+; RUN: llc < %s -verify-machineinstrs -verify-coalescing
+;
+; This function has a PHI with one undefined input. Verify that PHIElimination
+; inserts an IMPLICIT_DEF instruction in the predecessor so all paths to the use
+; pass through a def.
+
+%struct.xx_stack = type { i32, %struct.xx_stack* }
+
+define i32 @push(%struct.xx_stack* %stack) nounwind uwtable readonly ssp {
+entry:
+ %tobool1 = icmp eq %struct.xx_stack* %stack, null
+ br i1 %tobool1, label %for.end, label %for.body
+
+for.body:
+ %stack.addr.02 = phi %struct.xx_stack* [ %0, %for.body ], [ %stack, %entry ]
+ %next = getelementptr inbounds %struct.xx_stack* %stack.addr.02, i64 0, i32 1
+ %0 = load %struct.xx_stack** %next, align 8
+ %tobool = icmp eq %struct.xx_stack* %0, null
+ br i1 %tobool, label %for.end, label %for.body
+
+for.end:
+ %top.0.lcssa = phi %struct.xx_stack* [ undef, %entry ], [ %stack.addr.02, %for.body ]
+ %first = getelementptr inbounds %struct.xx_stack* %top.0.lcssa, i64 0, i32 0
+ %1 = load i32* %first, align 4
+ ret i32 %1
+}
diff --git a/test/CodeGen/Mips/2008-07-23-fpcmp.ll b/test/CodeGen/Mips/2008-07-23-fpcmp.ll
index 519e4b93a7..9c547f15c9 100644
--- a/test/CodeGen/Mips/2008-07-23-fpcmp.ll
+++ b/test/CodeGen/Mips/2008-07-23-fpcmp.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=mips -o %t
-; RUN: grep {c\\..*\\.s} %t | count 3
-; RUN: grep {bc1\[tf\]} %t | count 3
+; RUN: grep "c\..*\.s" %t | count 3
+; RUN: grep "bc1[tf]" %t | count 3
; FIXME: Disabled because branch instructions are generated where
; conditional move instructions are expected.
diff --git a/test/CodeGen/Mips/2008-07-29-icmp.ll b/test/CodeGen/Mips/2008-07-29-icmp.ll
index e85a749f7d..e88e3d3755 100644
--- a/test/CodeGen/Mips/2008-07-29-icmp.ll
+++ b/test/CodeGen/Mips/2008-07-29-icmp.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=mips | grep {b\[ne\]\[eq\]} | count 1
+; RUN: llc < %s -march=mips | grep "b[ne][eq]" | count 1
; FIXME: Disabled because branch instructions are generated where
; conditional move instructions are expected.
diff --git a/test/CodeGen/Mips/2010-07-20-Switch.ll b/test/CodeGen/Mips/2010-07-20-Switch.ll
index 7e98ff774d..261fe9db17 100644
--- a/test/CodeGen/Mips/2010-07-20-Switch.ll
+++ b/test/CodeGen/Mips/2010-07-20-Switch.ll
@@ -7,21 +7,20 @@ entry:
%x = alloca i32, align 4 ; <i32*> [#uses=2]
store volatile i32 2, i32* %x, align 4
%0 = load volatile i32* %x, align 4 ; <i32> [#uses=1]
-; STATIC-O32: lui $[[R0:[0-9]+]], %hi($JTI0_0)
-; STATIC-O32: addiu ${{[0-9]+}}, $[[R0]], %lo($JTI0_0)
-; STATIC-O32: sll ${{[0-9]+}}, ${{[0-9]+}}, 2
-; PIC-O32: lw $[[R0:[0-9]+]], %got($JTI0_0)
-; PIC-O32: addiu $[[R1:[0-9]+]], $[[R0]], %lo($JTI0_0)
-; PIC-O32: sll $[[R2:[0-9]+]], ${{[0-9]+}}, 2
-; PIC-O32: addu $[[R3:[0-9]+]], $[[R2]], $[[R1]]
-; PIC-O32: lw $[[R4:[0-9]+]], 0($[[R3]])
+; STATIC-O32: sll $[[R0:[0-9]+]], ${{[0-9]+}}, 2
+; STATIC-O32: lui $[[R1:[0-9]+]], %hi($JTI0_0)
+; STATIC-O32: addu $[[R2:[0-9]+]], $[[R0]], $[[R1]]
+; STATIC-O32: lw $[[R3:[0-9]+]], %lo($JTI0_0)($[[R2]])
+; PIC-O32: sll $[[R0:[0-9]+]], ${{[0-9]+}}, 2
+; PIC-O32: lw $[[R1:[0-9]+]], %got($JTI0_0)
+; PIC-O32: addu $[[R2:[0-9]+]], $[[R0]], $[[R1]]
+; PIC-O32: lw $[[R4:[0-9]+]], %lo($JTI0_0)($[[R2]])
; PIC-O32: addu $[[R5:[0-9]+]], $[[R4:[0-9]+]]
; PIC-O32: jr $[[R5]]
-; PIC-N64: ld $[[R0:[0-9]+]], %got_page($JTI0_0)
-; PIC-N64: daddiu $[[R1:[0-9]+]], $[[R0]], %got_ofst($JTI0_0)
-; PIC-N64: dsll $[[R2:[0-9]+]], ${{[0-9]+}}, 3
-; PIC-N64: daddu $[[R3:[0-9]+]], $[[R2:[0-9]+]], $[[R1]]
-; PIC-N64: ld $[[R4:[0-9]+]], 0($[[R3]])
+; PIC-N64: dsll $[[R0:[0-9]+]], ${{[0-9]+}}, 3
+; PIC-N64: ld $[[R1:[0-9]+]], %got_page($JTI0_0)
+; PIC-N64: daddu $[[R2:[0-9]+]], $[[R0:[0-9]+]], $[[R1]]
+; PIC-N64: ld $[[R4:[0-9]+]], %got_ofst($JTI0_0)($[[R2]])
; PIC-N64: daddu $[[R5:[0-9]+]], $[[R4:[0-9]+]]
; PIC-N64: jr $[[R5]]
switch i32 %0, label %bb4 [
@@ -34,7 +33,6 @@ entry:
bb1: ; preds = %entry
ret i32 2
-; CHECK: STATIC-O32: $BB0_2
bb2: ; preds = %entry
ret i32 0
diff --git a/test/CodeGen/Mips/asm-large-immediate.ll b/test/CodeGen/Mips/asm-large-immediate.ll
new file mode 100644
index 0000000000..246fff615e
--- /dev/null
+++ b/test/CodeGen/Mips/asm-large-immediate.ll
@@ -0,0 +1,10 @@
+; RUN: llc -march=mipsel < %s | FileCheck %s
+define void @test() {
+entry:
+; CHECK: /* result: 68719476738 */
+ tail call void asm sideeffect "/* result: ${0:c} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
+; CHECK: /* result: -68719476738 */
+ tail call void asm sideeffect "/* result: ${0:n} */", "i,~{dirflag},~{fpsr},~{flags}"( i64 68719476738 )
+ ret void
+}
+
diff --git a/test/CodeGen/Mips/fastcc.ll b/test/CodeGen/Mips/fastcc.ll
new file mode 100644
index 0000000000..82919e7139
--- /dev/null
+++ b/test/CodeGen/Mips/fastcc.ll
@@ -0,0 +1,253 @@
+; RUN: llc < %s -march=mipsel | FileCheck %s
+
+@gi0 = external global i32
+@gi1 = external global i32
+@gi2 = external global i32
+@gi3 = external global i32
+@gi4 = external global i32
+@gi5 = external global i32
+@gi6 = external global i32
+@gi7 = external global i32
+@gi8 = external global i32
+@gi9 = external global i32
+@gi10 = external global i32
+@gi11 = external global i32
+@gi12 = external global i32
+@gi13 = external global i32
+@gi14 = external global i32
+@gi15 = external global i32
+@gi16 = external global i32
+@gfa0 = external global float
+@gfa1 = external global float
+@gfa2 = external global float
+@gfa3 = external global float
+@gfa4 = external global float
+@gfa5 = external global float
+@gfa6 = external global float
+@gfa7 = external global float
+@gfa8 = external global float
+@gfa9 = external global float
+@gfa10 = external global float
+@gfa11 = external global float
+@gfa12 = external global float
+@gfa13 = external global float
+@gfa14 = external global float
+@gfa15 = external global float
+@gfa16 = external global float
+@gfa17 = external global float
+@gfa18 = external global float
+@gfa19 = external global float
+@gfa20 = external global float
+@gf0 = external global float
+@gf1 = external global float
+@gf2 = external global float
+@gf3 = external global float
+@gf4 = external global float
+@gf5 = external global float
+@gf6 = external global float
+@gf7 = external global float
+@gf8 = external global float
+@gf9 = external global float
+@gf10 = external global float
+@gf11 = external global float
+@gf12 = external global float
+@gf13 = external global float
+@gf14 = external global float
+@gf15 = external global float
+@gf16 = external global float
+@gf17 = external global float
+@gf18 = external global float
+@gf19 = external global float
+@gf20 = external global float
+@g0 = external global i32
+@g1 = external global i32
+@g2 = external global i32
+@g3 = external global i32
+@g4 = external global i32
+@g5 = external global i32
+@g6 = external global i32
+@g7 = external global i32
+@g8 = external global i32
+@g9 = external global i32
+@g10 = external global i32
+@g11 = external global i32
+@g12 = external global i32
+@g13 = external global i32
+@g14 = external global i32
+@g15 = external global i32
+@g16 = external global i32
+
+define void @caller0() nounwind {
+entry:
+; CHECK: caller0
+; CHECK: lw $3
+; CHECK: lw $24
+; CHECK: lw $15
+; CHECK: lw $14
+; CHECK: lw $13
+; CHECK: lw $12
+; CHECK: lw $11
+; CHECK: lw $10
+; CHECK: lw $9
+; CHECK: lw $8
+; CHECK: lw $7
+; CHECK: lw $6
+; CHECK: lw $5
+; CHECK: lw $4
+
+ %0 = load i32* @gi0, align 4
+ %1 = load i32* @gi1, align 4
+ %2 = load i32* @gi2, align 4
+ %3 = load i32* @gi3, align 4
+ %4 = load i32* @gi4, align 4
+ %5 = load i32* @gi5, align 4
+ %6 = load i32* @gi6, align 4
+ %7 = load i32* @gi7, align 4
+ %8 = load i32* @gi8, align 4
+ %9 = load i32* @gi9, align 4
+ %10 = load i32* @gi10, align 4
+ %11 = load i32* @gi11, align 4
+ %12 = load i32* @gi12, align 4
+ %13 = load i32* @gi13, align 4
+ %14 = load i32* @gi14, align 4
+ %15 = load i32* @gi15, align 4
+ %16 = load i32* @gi16, align 4
+ tail call fastcc void @callee0(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15, i32 %16)
+ ret void
+}
+
+define internal fastcc void @callee0(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %a7, i32 %a8, i32 %a9, i32 %a10, i32 %a11, i32 %a12, i32 %a13, i32 %a14, i32 %a15, i32 %a16) nounwind noinline {
+entry:
+; CHECK: callee0
+; CHECK: sw $4
+; CHECK: sw $5
+; CHECK: sw $6
+; CHECK: sw $7
+; CHECK: sw $8
+; CHECK: sw $9
+; CHECK: sw $10
+; CHECK: sw $11
+; CHECK: sw $12
+; CHECK: sw $13
+; CHECK: sw $14
+; CHECK: sw $15
+; CHECK: sw $24
+; CHECK: sw $3
+
+ store i32 %a0, i32* @g0, align 4
+ store i32 %a1, i32* @g1, align 4
+ store i32 %a2, i32* @g2, align 4
+ store i32 %a3, i32* @g3, align 4
+ store i32 %a4, i32* @g4, align 4
+ store i32 %a5, i32* @g5, align 4
+ store i32 %a6, i32* @g6, align 4
+ store i32 %a7, i32* @g7, align 4
+ store i32 %a8, i32* @g8, align 4
+ store i32 %a9, i32* @g9, align 4
+ store i32 %a10, i32* @g10, align 4
+ store i32 %a11, i32* @g11, align 4
+ store i32 %a12, i32* @g12, align 4
+ store i32 %a13, i32* @g13, align 4
+ store i32 %a14, i32* @g14, align 4
+ store i32 %a15, i32* @g15, align 4
+ store i32 %a16, i32* @g16, align 4
+ ret void
+}
+
+define void @caller1(float %a0, float %a1, float %a2, float %a3, float %a4, float %a5, float %a6, float %a7, float %a8, float %a9, float %a10, float %a11, float %a12, float %a13, float %a14, float %a15, float %a16, float %a17, float %a18, float %a19, float %a20) nounwind {
+entry:
+; CHECK: caller1
+; CHECK: lwc1 $f19
+; CHECK: lwc1 $f18
+; CHECK: lwc1 $f17
+; CHECK: lwc1 $f16
+; CHECK: lwc1 $f15
+; CHECK: lwc1 $f14
+; CHECK: lwc1 $f13
+; CHECK: lwc1 $f12
+; CHECK: lwc1 $f11
+; CHECK: lwc1 $f10
+; CHECK: lwc1 $f9
+; CHECK: lwc1 $f8
+; CHECK: lwc1 $f7
+; CHECK: lwc1 $f6
+; CHECK: lwc1 $f5
+; CHECK: lwc1 $f4
+; CHECK: lwc1 $f3
+; CHECK: lwc1 $f2
+; CHECK: lwc1 $f1
+; CHECK: lwc1 $f0
+
+ %0 = load float* @gfa0, align 4
+ %1 = load float* @gfa1, align 4
+ %2 = load float* @gfa2, align 4
+ %3 = load float* @gfa3, align 4
+ %4 = load float* @gfa4, align 4
+ %5 = load float* @gfa5, align 4
+ %6 = load float* @gfa6, align 4
+ %7 = load float* @gfa7, align 4
+ %8 = load float* @gfa8, align 4
+ %9 = load float* @gfa9, align 4
+ %10 = load float* @gfa10, align 4
+ %11 = load float* @gfa11, align 4
+ %12 = load float* @gfa12, align 4
+ %13 = load float* @gfa13, align 4
+ %14 = load float* @gfa14, align 4
+ %15 = load float* @gfa15, align 4
+ %16 = load float* @gfa16, align 4
+ %17 = load float* @gfa17, align 4
+ %18 = load float* @gfa18, align 4
+ %19 = load float* @gfa19, align 4
+ %20 = load float* @gfa20, align 4
+ tail call fastcc void @callee1(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15, float %16, float %17, float %18, float %19, float %20)
+ ret void
+}
+
+define internal fastcc void @callee1(float %a0, float %a1, float %a2, float %a3, float %a4, float %a5, float %a6, float %a7, float %a8, float %a9, float %a10, float %a11, float %a12, float %a13, float %a14, float %a15, float %a16, float %a17, float %a18, float %a19, float %a20) nounwind noinline {
+entry:
+; CHECK: callee1
+; CHECK: swc1 $f0
+; CHECK: swc1 $f1
+; CHECK: swc1 $f2
+; CHECK: swc1 $f3
+; CHECK: swc1 $f4
+; CHECK: swc1 $f5
+; CHECK: swc1 $f6
+; CHECK: swc1 $f7
+; CHECK: swc1 $f8
+; CHECK: swc1 $f9
+; CHECK: swc1 $f10
+; CHECK: swc1 $f11
+; CHECK: swc1 $f12
+; CHECK: swc1 $f13
+; CHECK: swc1 $f14
+; CHECK: swc1 $f15
+; CHECK: swc1 $f16
+; CHECK: swc1 $f17
+; CHECK: swc1 $f18
+; CHECK: swc1 $f19
+
+ store float %a0, float* @gf0, align 4
+ store float %a1, float* @gf1, align 4
+ store float %a2, float* @gf2, align 4
+ store float %a3, float* @gf3, align 4
+ store float %a4, float* @gf4, align 4
+ store float %a5, float* @gf5, align 4
+ store float %a6, float* @gf6, align 4
+ store float %a7, float* @gf7, align 4
+ store float %a8, float* @gf8, align 4
+ store float %a9, float* @gf9, align 4
+ store float %a10, float* @gf10, align 4
+ store float %a11, float* @gf11, align 4
+ store float %a12, float* @gf12, align 4
+ store float %a13, float* @gf13, align 4
+ store float %a14, float* @gf14, align 4
+ store float %a15, float* @gf15, align 4
+ store float %a16, float* @gf16, align 4
+ store float %a17, float* @gf17, align 4
+ store float %a18, float* @gf18, align 4
+ store float %a19, float* @gf19, align 4
+ store float %a20, float* @gf20, align 4
+ ret void
+}
+
diff --git a/test/CodeGen/Mips/i64arg.ll b/test/CodeGen/Mips/i64arg.ll
index 8b1f71b69f..e33021f880 100644
--- a/test/CodeGen/Mips/i64arg.ll
+++ b/test/CodeGen/Mips/i64arg.ll
@@ -10,8 +10,8 @@ entry:
; CHECK: jalr
tail call void @ff1(i32 %i, i64 1085102592623924856) nounwind
; CHECK: lw $25, %call16(ff2)
-; CHECK: lw $[[R2:[0-9]+]], 80($sp)
-; CHECK: lw $[[R3:[0-9]+]], 84($sp)
+; CHECK: lw $[[R2:[0-9]+]], 88($sp)
+; CHECK: lw $[[R3:[0-9]+]], 92($sp)
; CHECK: addu $4, $zero, $[[R2]]
; CHECK: addu $5, $zero, $[[R3]]
; CHECK: jalr $25
diff --git a/test/CodeGen/Mips/inlineasm-cnstrnt-bad-r-1.ll b/test/CodeGen/Mips/inlineasm-cnstrnt-bad-r-1.ll
deleted file mode 100644
index f5255fe0a3..0000000000
--- a/test/CodeGen/Mips/inlineasm-cnstrnt-bad-r-1.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-;
-; Register constraint "r" shouldn't take long long unless
-; The target is 64 bit.
-;
-; RUN: not llc -march=mipsel < %s 2> %t
-; RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
-
-define i32 @main() nounwind {
-entry:
-
-; r with long long
-;CHECK-ERRORS: error: couldn't allocate output register for constraint 'r'
-
- tail call i64 asm sideeffect "addi $0,$1,$2", "=r,r,i"(i64 7, i64 3) nounwind
- ret i32 0
-}
-
diff --git a/test/CodeGen/Mips/inlineasm-operand-code.ll b/test/CodeGen/Mips/inlineasm-operand-code.ll
index 2dcc10def2..d75f7f2f80 100644
--- a/test/CodeGen/Mips/inlineasm-operand-code.ll
+++ b/test/CodeGen/Mips/inlineasm-operand-code.ll
@@ -29,5 +29,23 @@ entry:
;CHECK: #NO_APP
tail call i32 asm sideeffect "addi $0,$1,${2:m}", "=r,r,I"(i32 7, i32 -3) nounwind
+; z with -3
+;CHECK: #APP
+;CHECK: addi ${{[0-9]+}},${{[0-9]+}},-3
+;CHECK: #NO_APP
+ tail call i32 asm sideeffect "addi $0,$1,${2:z}", "=r,r,I"(i32 7, i32 -3) nounwind
+
+; z with 0
+;CHECK: #APP
+;CHECK: addi ${{[0-9]+}},${{[0-9]+}},$0
+;CHECK: #NO_APP
+ tail call i32 asm sideeffect "addi $0,$1,${2:z}", "=r,r,I"(i32 7, i32 0) nounwind
+
+; a long long in 32 bit mode (use to assert)
+;CHECK: #APP
+;CHECK: addi ${{[0-9]+}},${{[0-9]+}},3
+;CHECK: #NO_APP
+ tail call i64 asm sideeffect "addi $0,$1,$2 \0A\09", "=r,r,X"(i64 1229801703532086340, i64 3) nounwind
+
ret i32 0
}
diff --git a/test/CodeGen/Mips/largeimmprinting.ll b/test/CodeGen/Mips/largeimmprinting.ll
index 0272dea5a7..c81cc764b4 100644
--- a/test/CodeGen/Mips/largeimmprinting.ll
+++ b/test/CodeGen/Mips/largeimmprinting.ll
@@ -7,7 +7,7 @@
define void @f() nounwind {
entry:
; CHECK: lui $at, 65534
-; CHECK: addiu $at, $at, -16
+; CHECK: addiu $at, $at, -24
; CHECK: addu $sp, $sp, $at
%agg.tmp = alloca %struct.S1, align 1
diff --git a/test/CodeGen/Mips/longbranch.ll b/test/CodeGen/Mips/longbranch.ll
new file mode 100644
index 0000000000..ef95d0011c
--- /dev/null
+++ b/test/CodeGen/Mips/longbranch.ll
@@ -0,0 +1,23 @@
+; RUN: llc -march=mipsel -force-mips-long-branch < %s | FileCheck %s
+
+@g0 = external global i32
+
+define void @foo1(i32 %s) nounwind {
+entry:
+; CHECK: lw $[[R0:[a-z0-9]+]], %got($BB0_3)(${{[a-z0-9]+}})
+; CHECK: addiu $[[R1:[a-z0-9]+]], $[[R0]], %lo($BB0_3)
+; CHECK: jr $[[R1]]
+
+ %tobool = icmp eq i32 %s, 0
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ %0 = load i32* @g0, align 4
+ %add = add nsw i32 %0, 12
+ store i32 %add, i32* @g0, align 4
+ br label %if.end
+
+if.end: ; preds = %entry, %if.then
+ ret void
+}
+
diff --git a/test/CodeGen/Mips/machineverifier.ll b/test/CodeGen/Mips/machineverifier.ll
new file mode 100644
index 0000000000..c673fe557e
--- /dev/null
+++ b/test/CodeGen/Mips/machineverifier.ll
@@ -0,0 +1,21 @@
+; RUN: llc < %s -march=mipsel -verify-machineinstrs
+; Make sure machine verifier understands the last instruction of a basic block
+; is not the terminator instruction after delay slot filler pass is run.
+
+@g = external global i32
+
+define void @foo() nounwind {
+entry:
+ %0 = load i32* @g, align 4
+ %tobool = icmp eq i32 %0, 0
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ %add = add nsw i32 %0, 10
+ store i32 %add, i32* @g, align 4
+ br label %if.end
+
+if.end: ; preds = %entry, %if.then
+ ret void
+}
+
diff --git a/test/CodeGen/Mips/memcpy.ll b/test/CodeGen/Mips/memcpy.ll
new file mode 100644
index 0000000000..39764a9363
--- /dev/null
+++ b/test/CodeGen/Mips/memcpy.ll
@@ -0,0 +1,19 @@
+; RUN: llc -march=mipsel < %s | FileCheck %s
+
+%struct.S1 = type { i32, [41 x i8] }
+
+@.str = private unnamed_addr constant [31 x i8] c"abcdefghijklmnopqrstuvwxyzABCD\00", align 1
+
+define void @foo1(%struct.S1* %s1, i8 signext %n) nounwind {
+entry:
+; CHECK-NOT: call16(memcpy
+
+ %arraydecay = getelementptr inbounds %struct.S1* %s1, i32 0, i32 1, i32 0
+ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %arraydecay, i8* getelementptr inbounds ([31 x i8]* @.str, i32 0, i32 0), i32 31, i32 1, i1 false)
+ %arrayidx = getelementptr inbounds %struct.S1* %s1, i32 0, i32 1, i32 40
+ store i8 %n, i8* %arrayidx, align 1
+ ret void
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
+
diff --git a/test/CodeGen/Mips/o32_cc_byval.ll b/test/CodeGen/Mips/o32_cc_byval.ll
index 9de78c11be..d5eac994c0 100644
--- a/test/CodeGen/Mips/o32_cc_byval.ll
+++ b/test/CodeGen/Mips/o32_cc_byval.ll
@@ -13,16 +13,16 @@ entry:
; CHECK: lw $[[R1:[0-9]+]], %got(f1.s1)
; CHECK: addiu $[[R0:[0-9]+]], $[[R1]], %lo(f1.s1)
; CHECK: lw $[[R6:[0-9]+]], 28($[[R0]])
-; CHECK: lw $[[R5:[0-9]+]], 24($[[R0]])
-; CHECK: lw $[[R4:[0-9]+]], 20($[[R0]])
-; CHECK: lw $[[R3:[0-9]+]], 16($[[R0]])
-; CHECK: lw $[[R7:[0-9]+]], 12($[[R0]])
-; CHECK: lw $[[R2:[0-9]+]], 8($[[R0]])
; CHECK: sw $[[R6]], 36($sp)
+; CHECK: lw $[[R5:[0-9]+]], 24($[[R0]])
; CHECK: sw $[[R5]], 32($sp)
+; CHECK: lw $[[R4:[0-9]+]], 20($[[R0]])
; CHECK: sw $[[R4]], 28($sp)
+; CHECK: lw $[[R3:[0-9]+]], 16($[[R0]])
; CHECK: sw $[[R3]], 24($sp)
+; CHECK: lw $[[R7:[0-9]+]], 12($[[R0]])
; CHECK: sw $[[R7]], 20($sp)
+; CHECK: lw $[[R2:[0-9]+]], 8($[[R0]])
; CHECK: sw $[[R2]], 16($sp)
; CHECK: lw $7, 4($[[R0]])
; CHECK: lw $6, %lo(f1.s1)($[[R1]])
@@ -43,16 +43,16 @@ declare void @callee3(float, %struct.S3* byval, %struct.S1* byval)
define void @f2(float %f, %struct.S1* nocapture byval %s1) nounwind {
entry:
-; CHECK: addiu $sp, $sp, -48
-; CHECK: sw $7, 60($sp)
-; CHECK: sw $6, 56($sp)
-; CHECK: lw $4, 80($sp)
-; CHECK: ldc1 $f[[F0:[0-9]+]], 72($sp)
-; CHECK: lw $[[R3:[0-9]+]], 64($sp)
-; CHECK: lw $[[R4:[0-9]+]], 68($sp)
-; CHECK: lw $[[R2:[0-9]+]], 60($sp)
-; CHECK: lh $[[R1:[0-9]+]], 58($sp)
-; CHECK: lb $[[R0:[0-9]+]], 56($sp)
+; CHECK: addiu $sp, $sp, -56
+; CHECK: sw $7, 68($sp)
+; CHECK: sw $6, 64($sp)
+; CHECK: lw $4, 88($sp)
+; CHECK: ldc1 $f[[F0:[0-9]+]], 80($sp)
+; CHECK: lw $[[R3:[0-9]+]], 72($sp)
+; CHECK: lw $[[R4:[0-9]+]], 76($sp)
+; CHECK: lw $[[R2:[0-9]+]], 68($sp)
+; CHECK: lh $[[R1:[0-9]+]], 66($sp)
+; CHECK: lb $[[R0:[0-9]+]], 64($sp)
; CHECK: sw $[[R0]], 32($sp)
; CHECK: sw $[[R1]], 28($sp)
; CHECK: sw $[[R2]], 24($sp)
@@ -80,13 +80,13 @@ declare void @callee4(i32, double, i64, i32, i16 signext, i8 signext, float)
define void @f3(%struct.S2* nocapture byval %s2) nounwind {
entry:
-; CHECK: addiu $sp, $sp, -48
-; CHECK: sw $7, 60($sp)
-; CHECK: sw $6, 56($sp)
-; CHECK: sw $5, 52($sp)
-; CHECK: sw $4, 48($sp)
-; CHECK: lw $4, 48($sp)
-; CHECK: lw $[[R0:[0-9]+]], 60($sp)
+; CHECK: addiu $sp, $sp, -56
+; CHECK: sw $7, 68($sp)
+; CHECK: sw $6, 64($sp)
+; CHECK: sw $5, 60($sp)
+; CHECK: sw $4, 56($sp)
+; CHECK: lw $4, 56($sp)
+; CHECK: lw $[[R0:[0-9]+]], 68($sp)
; CHECK: sw $[[R0]], 24($sp)
%arrayidx = getelementptr inbounds %struct.S2* %s2, i32 0, i32 0, i32 0
@@ -99,13 +99,13 @@ entry:
define void @f4(float %f, %struct.S3* nocapture byval %s3, %struct.S1* nocapture byval %s1) nounwind {
entry:
-; CHECK: addiu $sp, $sp, -48
-; CHECK: sw $7, 60($sp)
-; CHECK: sw $6, 56($sp)
-; CHECK: sw $5, 52($sp)
-; CHECK: lw $4, 60($sp)
-; CHECK: lw $[[R1:[0-9]+]], 80($sp)
-; CHECK: lb $[[R0:[0-9]+]], 52($sp)
+; CHECK: addiu $sp, $sp, -56
+; CHECK: sw $7, 68($sp)
+; CHECK: sw $6, 64($sp)
+; CHECK: sw $5, 60($sp)
+; CHECK: lw $4, 68($sp)
+; CHECK: lw $[[R1:[0-9]+]], 88($sp)
+; CHECK: lb $[[R0:[0-9]+]], 60($sp)
; CHECK: sw $[[R0]], 32($sp)
; CHECK: sw $[[R1]], 24($sp)
diff --git a/test/CodeGen/Mips/o32_cc_vararg.ll b/test/CodeGen/Mips/o32_cc_vararg.ll
index 4a3d9ab837..49d614c820 100644
--- a/test/CodeGen/Mips/o32_cc_vararg.ll
+++ b/test/CodeGen/Mips/o32_cc_vararg.ll
@@ -29,11 +29,11 @@ entry:
ret i32 %tmp
; CHECK: va1:
-; CHECK: addiu $sp, $sp, -16
-; CHECK: sw $7, 28($sp)
-; CHECK: sw $6, 24($sp)
-; CHECK: sw $5, 20($sp)
-; CHECK: lw $2, 20($sp)
+; CHECK: addiu $sp, $sp, -24
+; CHECK: sw $7, 36($sp)
+; CHECK: sw $6, 32($sp)
+; CHECK: sw $5, 28($sp)
+; CHECK: lw $2, 28($sp)
}
; check whether the variable double argument will be accessed from the 8-byte
@@ -55,11 +55,11 @@ entry:
ret double %tmp
; CHECK: va2:
-; CHECK: addiu $sp, $sp, -16
-; CHECK: sw $7, 28($sp)
-; CHECK: sw $6, 24($sp)
-; CHECK: sw $5, 20($sp)
-; CHECK: addiu $[[R0:[0-9]+]], $sp, 20
+; CHECK: addiu $sp, $sp, -24
+; CHECK: sw $7, 36($sp)
+; CHECK: sw $6, 32($sp)
+; CHECK: sw $5, 28($sp)
+; CHECK: addiu $[[R0:[0-9]+]], $sp, 28
; CHECK: addiu $[[R1:[0-9]+]], $[[R0]], 7
; CHECK: addiu $[[R2:[0-9]+]], $zero, -8
; CHECK: and $[[R3:[0-9]+]], $[[R1]], $[[R2]]
@@ -83,10 +83,10 @@ entry:
ret i32 %tmp
; CHECK: va3:
-; CHECK: addiu $sp, $sp, -16
-; CHECK: sw $7, 28($sp)
-; CHECK: sw $6, 24($sp)
-; CHECK: lw $2, 24($sp)
+; CHECK: addiu $sp, $sp, -24
+; CHECK: sw $7, 36($sp)
+; CHECK: sw $6, 32($sp)
+; CHECK: lw $2, 32($sp)
}
; double
@@ -106,11 +106,11 @@ entry:
ret double %tmp
; CHECK: va4:
-; CHECK: addiu $sp, $sp, -24
-; CHECK: sw $7, 36($sp)
-; CHECK: sw $6, 32($sp)
-; CHECK: addiu ${{[0-9]+}}, $sp, 32
-; CHECK: ldc1 $f0, 32($sp)
+; CHECK: addiu $sp, $sp, -32
+; CHECK: sw $7, 44($sp)
+; CHECK: sw $6, 40($sp)
+; CHECK: addiu ${{[0-9]+}}, $sp, 40
+; CHECK: ldc1 $f0, 40($sp)
}
; int
@@ -134,9 +134,9 @@ entry:
ret i32 %tmp
; CHECK: va5:
-; CHECK: addiu $sp, $sp, -24
-; CHECK: sw $7, 36($sp)
-; CHECK: lw $2, 36($sp)
+; CHECK: addiu $sp, $sp, -32
+; CHECK: sw $7, 44($sp)
+; CHECK: lw $2, 44($sp)
}
; double
@@ -160,9 +160,9 @@ entry:
ret double %tmp
; CHECK: va6:
-; CHECK: addiu $sp, $sp, -24
-; CHECK: sw $7, 36($sp)
-; CHECK: addiu $[[R0:[0-9]+]], $sp, 36
+; CHECK: addiu $sp, $sp, -32
+; CHECK: sw $7, 44($sp)
+; CHECK: addiu $[[R0:[0-9]+]], $sp, 44
; CHECK: addiu $[[R1:[0-9]+]], $[[R0]], 7
; CHECK: addiu $[[R2:[0-9]+]], $zero, -8
; CHECK: and $[[R3:[0-9]+]], $[[R1]], $[[R2]]
@@ -188,8 +188,8 @@ entry:
ret i32 %tmp
; CHECK: va7:
-; CHECK: addiu $sp, $sp, -24
-; CHECK: lw $2, 40($sp)
+; CHECK: addiu $sp, $sp, -32
+; CHECK: lw $2, 48($sp)
}
; double
@@ -211,9 +211,9 @@ entry:
ret double %tmp
; CHECK: va8:
-; CHECK: addiu $sp, $sp, -32
-; CHECK: addiu ${{[0-9]+}}, $sp, 48
-; CHECK: ldc1 $f0, 48($sp)
+; CHECK: addiu $sp, $sp, -40
+; CHECK: addiu ${{[0-9]+}}, $sp, 56
+; CHECK: ldc1 $f0, 56($sp)
}
; int
@@ -237,8 +237,8 @@ entry:
ret i32 %tmp
; CHECK: va9:
-; CHECK: addiu $sp, $sp, -32
-; CHECK: lw $2, 52($sp)
+; CHECK: addiu $sp, $sp, -40
+; CHECK: lw $2, 60($sp)
}
; double
@@ -262,8 +262,8 @@ entry:
ret double %tmp
; CHECK: va10:
-; CHECK: addiu $sp, $sp, -32
-; CHECK: addiu $[[R0:[0-9]+]], $sp, 52
+; CHECK: addiu $sp, $sp, -40
+; CHECK: addiu $[[R0:[0-9]+]], $sp, 60
; CHECK: addiu $[[R1:[0-9]+]], $[[R0]], 7
; CHECK: addiu $[[R2:[0-9]+]], $zero, -8
; CHECK: and $[[R3:[0-9]+]], $[[R1]], $[[R2]]
diff --git a/test/CodeGen/Mips/stacksize.ll b/test/CodeGen/Mips/stacksize.ll
new file mode 100644
index 0000000000..42021b2151
--- /dev/null
+++ b/test/CodeGen/Mips/stacksize.ll
@@ -0,0 +1,9 @@
+; RUN: llc -march=mipsel -relocation-model=static < %s | FileCheck %s
+
+define i32 @foo(i32 %a) nounwind readnone {
+entry:
+; check that stack size is zero.
+; CHECK-NOT: addiu $sp, $sp
+ %add = add nsw i32 %a, 1
+ ret i32 %add
+}
diff --git a/test/CodeGen/Mips/tls-alias.ll b/test/CodeGen/Mips/tls-alias.ll
new file mode 100644
index 0000000000..d681091f4c
--- /dev/null
+++ b/test/CodeGen/Mips/tls-alias.ll
@@ -0,0 +1,10 @@
+; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s
+
+@foo = thread_local global i32 42
+@bar = hidden alias i32* @foo
+
+define i32* @zed() {
+; CHECK: __tls_get_addr
+; CHECK-NEXT: %tlsgd(bar)
+ ret i32* @bar
+}
diff --git a/test/CodeGen/Mips/tls-models.ll b/test/CodeGen/Mips/tls-models.ll
new file mode 100644
index 0000000000..8f5789ec79
--- /dev/null
+++ b/test/CodeGen/Mips/tls-models.ll
@@ -0,0 +1,113 @@
+; RUN: llc -march=mipsel < %s | FileCheck -check-prefix=CHECK-PIC %s
+; RUN: llc -march=mipsel -relocation-model=static < %s | FileCheck -check-prefix=CHECK-NONPIC %s
+
+@external_gd = external thread_local global i32
+@internal_gd = internal thread_local global i32 42
+
+@external_ld = external thread_local(localdynamic) global i32
+@internal_ld = internal thread_local(localdynamic) global i32 42
+
+@external_ie = external thread_local(initialexec) global i32
+@internal_ie = internal thread_local(initialexec) global i32 42
+
+@external_le = external thread_local(localexec) global i32
+@internal_le = internal thread_local(localexec) global i32 42
+
+; ----- no model specified -----
+
+define i32* @f1() {
+entry:
+ ret i32* @external_gd
+
+ ; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
+ ; CHECK-NONPIC: f1:
+ ; CHECK-NONPIC: %gottprel
+ ; CHECK-PIC: f1:
+ ; CHECK-PIC: %tlsgd
+}
+
+define i32* @f2() {
+entry:
+ ret i32* @internal_gd
+
+ ; Non-PIC code can use local exec, PIC code can use local dynamic.
+ ; CHECK-NONPIC: f2:
+ ; CHECK-NONPIC: %tprel_hi
+ ; CHECK-PIC: f2:
+ ; CHECK-PIC: %tlsldm
+}
+
+
+; ----- localdynamic specified -----
+
+define i32* @f3() {
+entry:
+ ret i32* @external_ld
+
+ ; Non-PIC code can use initial exec, PIC should use local dynamic.
+ ; CHECK-NONPIC: f3:
+ ; CHECK-NONPIC: %gottprel
+ ; CHECK-PIC: f3:
+ ; CHECK-PIC: %tlsldm
+}
+
+define i32* @f4() {
+entry:
+ ret i32* @internal_ld
+
+ ; Non-PIC code can use local exec, PIC code can use local dynamic.
+ ; CHECK-NONPIC: f4:
+ ; CHECK-NONPIC: %tprel_hi
+ ; CHECK-PIC: f4:
+ ; CHECK-PIC: %tlsldm
+}
+
+
+; ----- initialexec specified -----
+
+define i32* @f5() {
+entry:
+ ret i32* @external_ie
+
+ ; Non-PIC and PIC code will use initial exec as specified.
+ ; CHECK-NONPIC: f5:
+ ; CHECK-NONPIC: %gottprel
+ ; CHECK-PIC: f5:
+ ; CHECK-PIC: %gottprel
+}
+
+define i32* @f6() {
+entry:
+ ret i32* @internal_ie
+
+ ; Non-PIC code can use local exec, PIC code use initial exec as specified.
+ ; CHECK-NONPIC: f6:
+ ; CHECK-NONPIC: %tprel_hi
+ ; CHECK-PIC: f6:
+ ; CHECK-PIC: %gottprel
+}
+
+
+; ----- localexec specified -----
+
+define i32* @f7() {
+entry:
+ ret i32* @external_le
+
+ ; Non-PIC and PIC code will use local exec as specified.
+ ; CHECK-NONPIC: f7:
+ ; CHECK-NONPIC: %tprel_hi
+ ; CHECK-PIC: f7:
+ ; CHECK-PIC: %tprel_hi
+}
+
+define i32* @f8() {
+entry:
+ ret i32* @internal_le
+
+ ; Non-PIC and PIC code will use local exec as specified.
+ ; CHECK-NONPIC: f8:
+ ; CHECK-NONPIC: %tprel_hi
+ ; CHECK-PIC: f8:
+ ; CHECK-PIC: %tprel_hi
+}
diff --git a/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll b/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll
index 5d1df468a6..43736601fe 100644
--- a/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll
+++ b/test/CodeGen/PowerPC/2005-09-02-LegalizeDuplicatesCalls.ll
@@ -1,7 +1,7 @@
; This function should have exactly one call to fixdfdi, no more!
; RUN: llc < %s -march=ppc32 -mattr=-64bit | \
-; RUN: grep {bl .*fixdfdi} | count 1
+; RUN: grep "bl .*fixdfdi" | count 1
define double @test2(double %tmp.7705) {
%mem_tmp.2.0.in = fptosi double %tmp.7705 to i64 ; <i64> [#uses=1]
diff --git a/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll b/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll
index 97bb48e96e..aeb28af4be 100644
--- a/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll
+++ b/test/CodeGen/PowerPC/2006-01-11-darwin-fp-argument.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | not grep {, f1}
+; RUN: llc < %s | not grep ", f1"
target datalayout = "E-p:32:32"
target triple = "powerpc-apple-darwin8.2.0"
diff --git a/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll b/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll
index 969772ee2b..7e845382a8 100644
--- a/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll
+++ b/test/CodeGen/PowerPC/2006-04-05-splat-ish.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
-; RUN: grep {vspltish v.*, 10}
+; RUN: grep "vspltish v.*, 10"
define void @test(<8 x i16>* %P) {
%tmp = load <8 x i16>* %P ; <<8 x i16>> [#uses=1]
diff --git a/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll b/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
index 86fd947502..73736c57fe 100644
--- a/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
+++ b/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {foo r3, r4}
-; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {bari r3, 47}
+; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep "foo r3, r4"
+; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep "bari r3, 47"
; PR1351
diff --git a/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll b/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll
index 72e93a9cce..b85792c6f4 100644
--- a/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll
+++ b/test/CodeGen/PowerPC/2007-05-30-dagcombine-miscomp.ll
@@ -1,7 +1,7 @@
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 = "powerpc-apple-darwin8.8.0"
-; RUN: llc < %s -march=ppc32 | grep {rlwinm r3, r3, 23, 30, 30}
+; RUN: llc < %s -march=ppc32 | grep "rlwinm r3, r3, 23, 30, 30"
; PR1473
define zeroext i8 @foo(i16 zeroext %a) {
diff --git a/test/CodeGen/PowerPC/Frames-leaf.ll b/test/CodeGen/PowerPC/Frames-leaf.ll
index c2e1d6bddc..7b1c464f9e 100644
--- a/test/CodeGen/PowerPC/Frames-leaf.ll
+++ b/test/CodeGen/PowerPC/Frames-leaf.ll
@@ -1,35 +1,35 @@
; RUN: llc < %s -march=ppc32 | \
-; RUN: not grep {stw r31, 20(r1)}
+; RUN: not grep "stw r31, 20(r1)"
; RUN: llc < %s -march=ppc32 | \
-; RUN: not grep {stwu r1, -.*(r1)}
+; RUN: not grep "stwu r1, -.*(r1)"
; RUN: llc < %s -march=ppc32 | \
-; RUN: not grep {addi r1, r1, }
+; RUN: not grep "addi r1, r1, "
; RUN: llc < %s -march=ppc32 | \
-; RUN: not grep {lwz r31, 20(r1)}
+; RUN: not grep "lwz r31, 20(r1)"
; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {stw r31, 20(r1)}
+; RUN: not grep "stw r31, 20(r1)"
; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {stwu r1, -.*(r1)}
+; RUN: not grep "stwu r1, -.*(r1)"
; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {addi r1, r1, }
+; RUN: not grep "addi r1, r1, "
; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
-; RUN: not grep {lwz r31, 20(r1)}
+; RUN: not grep "lwz r31, 20(r1)"
; RUN: llc < %s -march=ppc64 | \
-; RUN: not grep {std r31, 40(r1)}
+; RUN: not grep "std r31, 40(r1)"
; RUN: llc < %s -march=ppc64 | \
-; RUN: not grep {stdu r1, -.*(r1)}
+; RUN: not grep "stdu r1, -.*(r1)"
; RUN: llc < %s -march=ppc64 | \
-; RUN: not grep {addi r1, r1, }
+; RUN: not grep "addi r1, r1, "
; RUN: llc < %s -march=ppc64 | \
-; RUN: not grep {ld r31, 40(r1)}
+; RUN: not grep "ld r31, 40(r1)"
; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {stw r31, 40(r1)}
+; RUN: not grep "stw r31, 40(r1)"
; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {stdu r1, -.*(r1)}
+; RUN: not grep "stdu r1, -.*(r1)"
; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {addi r1, r1, }
+; RUN: not grep "addi r1, r1, "
; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
-; RUN: not grep {ld r31, 40(r1)}
+; RUN: not grep "ld r31, 40(r1)"
define i32* @f1() {
%tmp = alloca i32, i32 2 ; <i32*> [#uses=1]
diff --git a/test/CodeGen/PowerPC/Frames-small.ll b/test/CodeGen/PowerPC/Frames-small.ll
index ecd5ecd2ec..0f6bd1021f 100644
--- a/test/CodeGen/PowerPC/Frames-small.ll
+++ b/test/CodeGen/PowerPC/Frames-small.ll
@@ -1,26 +1,26 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -o %t1
-; RUN: not grep {stw r31, -4(r1)} %t1
-; RUN: grep {stwu r1, -16448(r1)} %t1
-; RUN: grep {addi r1, r1, 16448} %t1
+; RUN: not grep "stw r31, -4(r1)" %t1
+; RUN: grep "stwu r1, -16448(r1)" %t1
+; RUN: grep "addi r1, r1, 16448" %t1
; RUN: llc < %s -march=ppc32 | \
-; RUN: not grep {lwz r31, -4(r1)}
+; RUN: not grep "lwz r31, -4(r1)"
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
; RUN: -o %t2
-; RUN: grep {stw r31, -4(r1)} %t2
-; RUN: grep {stwu r1, -16448(r1)} %t2
-; RUN: grep {addi r1, r1, 16448} %t2
-; RUN: grep {lwz r31, -4(r1)} %t2
+; RUN: grep "stw r31, -4(r1)" %t2
+; RUN: grep "stwu r1, -16448(r1)" %t2
+; RUN: grep "addi r1, r1, 16448" %t2
+; RUN: grep "lwz r31, -4(r1)" %t2
; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin8 -o %t3
-; RUN: not grep {std r31, -8(r1)} %t3
-; RUN: grep {stdu r1, -16496(r1)} %t3
-; RUN: grep {addi r1, r1, 16496} %t3
-; RUN: not grep {ld r31, -8(r1)} %t3
+; RUN: not grep "std r31, -8(r1)" %t3
+; RUN: grep "stdu r1, -16496(r1)" %t3
+; RUN: grep "addi r1, r1, 16496" %t3
+; RUN: not grep "ld r31, -8(r1)" %t3
; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
; RUN: -o %t4
-; RUN: grep {std r31, -8(r1)} %t4
-; RUN: grep {stdu r1, -16512(r1)} %t4
-; RUN: grep {addi r1, r1, 16512} %t4
-; RUN: grep {ld r31, -8(r1)} %t4
+; RUN: grep "std r31, -8(r1)" %t4
+; RUN: grep "stdu r1, -16512(r1)" %t4
+; RUN: grep "addi r1, r1, 16512" %t4
+; RUN: grep "ld r31, -8(r1)" %t4
define i32* @f1() {
%tmp = alloca i32, i32 4095 ; <i32*> [#uses=1]
diff --git a/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll b/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll
index 7b0d69cb3b..6f985c819f 100644
--- a/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll
+++ b/test/CodeGen/PowerPC/LargeAbsoluteAddr.ll
@@ -1,9 +1,9 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | \
-; RUN: grep {stw r4, 32751}
+; RUN: grep "stw r4, 32751"
; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin | \
-; RUN: grep {stw r4, 32751}
+; RUN: grep "stw r4, 32751"
; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin | \
-; RUN: grep {std r4, 9024}
+; RUN: grep "std r4, 9024"
define void @test() nounwind {
store i32 0, i32* inttoptr (i64 48725999 to i32*)
diff --git a/test/CodeGen/PowerPC/a2-fp-basic.ll b/test/CodeGen/PowerPC/a2-fp-basic.ll
index 932ad7a63c..de3aa7c317 100644
--- a/test/CodeGen/PowerPC/a2-fp-basic.ll
+++ b/test/CodeGen/PowerPC/a2-fp-basic.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc64 -mcpu=a2 | FileCheck %s
+; RUN: llc < %s -march=ppc64 -mcpu=a2 -fp-contract=fast | FileCheck %s
%0 = type { double, double }
diff --git a/test/CodeGen/PowerPC/and-imm.ll b/test/CodeGen/PowerPC/and-imm.ll
index 64a45e50c0..6fd484b40b 100644
--- a/test/CodeGen/PowerPC/and-imm.ll
+++ b/test/CodeGen/PowerPC/and-imm.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc32 | not grep {ori\\|lis}
+; RUN: llc < %s -march=ppc32 | not grep "ori\|lis"
; andi. r3, r3, 32769
define i32 @test(i32 %X) {
diff --git a/test/CodeGen/PowerPC/big-endian-actual-args.ll b/test/CodeGen/PowerPC/big-endian-actual-args.ll
index 009f46811e..898ad7cb85 100644
--- a/test/CodeGen/PowerPC/big-endian-actual-args.ll
+++ b/test/CodeGen/PowerPC/big-endian-actual-args.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {addc 4, 4, 6}
+; RUN: grep "addc 4, 4, 6"
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {adde 3, 3, 5}
+; RUN: grep "adde 3, 3, 5"
define i64 @foo(i64 %x, i64 %y) {
%z = add i64 %x, %y
diff --git a/test/CodeGen/PowerPC/big-endian-call-result.ll b/test/CodeGen/PowerPC/big-endian-call-result.ll
index fe85404cb9..760833ce20 100644
--- a/test/CodeGen/PowerPC/big-endian-call-result.ll
+++ b/test/CodeGen/PowerPC/big-endian-call-result.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {addic 4, 4, 1}
+; RUN: grep "addic 4, 4, 1"
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
-; RUN: grep {addze 3, 3}
+; RUN: grep "addze 3, 3"
declare i64 @foo()
diff --git a/test/CodeGen/PowerPC/branch-opt.ll b/test/CodeGen/PowerPC/branch-opt.ll
index cc02e406aa..dda1538f1c 100644
--- a/test/CodeGen/PowerPC/branch-opt.ll
+++ b/test/CodeGen/PowerPC/branch-opt.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=ppc32 | \
-; RUN: grep {b LBB.*} | count 4
+; RUN: grep "b LBB.*" | count 4
target datalayout = "E-p:32:32"
target triple = "powerpc-apple-darwin8.7.0"
diff --git a/test/CodeGen/PowerPC/calls.ll b/test/CodeGen/PowerPC/calls.ll
index 29bcb20811..dcdda57214 100644
--- a/test/CodeGen/PowerPC/calls.ll
+++ b/test/CodeGen/PowerPC/calls.ll
@@ -1,11 +1,11 @@
; Test various forms of calls.
; RUN: llc < %s -march=ppc32 | \
-; RUN: grep {bl } | count 1
+; RUN: grep "bl " | count 1
; RUN: llc < %s -march=ppc32 | \
-; RUN: grep {bctrl} | count 1
+; RUN: grep "bctrl" | count 1
; RUN: llc < %s -march=ppc32 | \
-; RUN: grep {bla } | count 1
+; RUN: grep "bla " | count 1
declare void @foo()
diff --git a/test/CodeGen/PowerPC/coalesce-ext.ll b/test/CodeGen/PowerPC/coalesce-ext.ll
new file mode 100644
index 0000000000..cc80f83307
--- /dev/null
+++ b/test/CodeGen/PowerPC/coalesce-ext.ll
@@ -0,0 +1,17 @@
+; RUN: llc -march=ppc64 -mtriple=powerpc64-apple-darwin < %s | FileCheck %s
+; Check that the peephole optimizer knows about sext and zext instructions.
+; CHECK: test1sext
+define i32 @test1sext(i64 %A, i64 %B, i32* %P, i64 *%P2) nounwind {
+ %C = add i64 %A, %B
+ ; CHECK: add [[SUM:r[0-9]+]], r3, r4
+ %D = trunc i64 %C to i32
+ %E = shl i64 %C, 32
+ %F = ashr i64 %E, 32
+ ; CHECK: extsw [[EXT:r[0-9]+]], [[SUM]]
+ store volatile i64 %F, i64 *%P2
+ ; CHECK: std [[EXT]]
+ store volatile i32 %D, i32* %P
+ ; Reuse low bits of extended register, don't extend live range of SUM.
+ ; CHECK: stw [[EXT]]
+ ret i32 %D
+}
diff --git a/test/CodeGen/PowerPC/compare-simm.ll b/test/CodeGen/PowerPC/compare-simm.ll
index 92d1dbe902..94c5c0290f 100644
--- a/test/CodeGen/PowerPC/compare-simm.ll
+++ b/test/CodeGen/PowerPC/compare-simm.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {cmpwi cr0, r3, -1}
+; RUN: grep "cmpwi cr0, r3, -1"
define i32 @test(i32 %x) nounwind {
%c = icmp eq i32 %x, -1
diff --git a/test/CodeGen/PowerPC/constants.ll b/test/CodeGen/PowerPC/constants.ll
index 8901e02d3b..9efca916d6 100644
--- a/test/CodeGen/PowerPC/constants.ll
+++ b/test/CodeGen/PowerPC/constants.ll
@@ -4,7 +4,7 @@
; RUN: llc < %s -march=ppc32 | \
; RUN: grep ori | count 3
; RUN: llc < %s -march=ppc32 | \
-; RUN: grep {li } | count 4
+; RUN: grep "li " | count 4
define i32 @f1() {
entry:
diff --git a/test/CodeGen/PowerPC/ctrloop-s000.ll b/test/CodeGen/PowerPC/ctrloop-s000.ll
new file mode 100644
index 0000000000..dcea06f29e
--- /dev/null
+++ b/test/CodeGen/PowerPC/ctrloop-s000.ll
@@ -0,0 +1,156 @@
+; ModuleID = 'tsc_s000.c'
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+; RUN: llc < %s -march=ppc64 | FileCheck %s
+
+@Y = common global [16000 x double] zeroinitializer, align 32
+@X = common global [16000 x double] zeroinitializer, align 32
+@Z = common global [16000 x double] zeroinitializer, align 32
+@U = common global [16000 x double] zeroinitializer, align 32
+@V = common global [16000 x double] zeroinitializer, align 32
+@aa = common global [256 x [256 x double]] zeroinitializer, align 32
+@bb = common global [256 x [256 x double]] zeroinitializer, align 32
+@cc = common global [256 x [256 x double]] zeroinitializer, align 32
+@array = common global [65536 x double] zeroinitializer, align 32
+@x = common global [16000 x double] zeroinitializer, align 32
+@temp = common global double 0.000000e+00, align 8
+@temp_int = common global i32 0, align 4
+@a = common global [16000 x double] zeroinitializer, align 32
+@b = common global [16000 x double] zeroinitializer, align 32
+@c = common global [16000 x double] zeroinitializer, align 32
+@d = common global [16000 x double] zeroinitializer, align 32
+@e = common global [16000 x double] zeroinitializer, align 32
+@tt = common global [256 x [256 x double]] zeroinitializer, align 32
+@indx = common global [16000 x i32] zeroinitializer, align 32
+@xx = common global double* null, align 8
+@yy = common global double* null, align 8
+
+define i32 @s000() nounwind {
+entry:
+ br label %for.cond1.preheader
+
+for.cond1.preheader: ; preds = %for.end, %entry
+ %nl.010 = phi i32 [ 0, %entry ], [ %inc7, %for.end ]
+ br label %for.body3
+
+for.body3: ; preds = %for.body3, %for.cond1.preheader
+ %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next.15, %for.body3 ]
+ %arrayidx = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv
+ %0 = load double* %arrayidx, align 32, !tbaa !0
+ %add = fadd double %0, 1.000000e+00
+ %arrayidx5 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv
+ store double %add, double* %arrayidx5, align 32, !tbaa !0
+ %indvars.iv.next11 = or i64 %indvars.iv, 1
+ %arrayidx.1 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next11
+ %1 = load double* %arrayidx.1, align 8, !tbaa !0
+ %add.1 = fadd double %1, 1.000000e+00
+ %arrayidx5.1 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next11
+ store double %add.1, double* %arrayidx5.1, align 8, !tbaa !0
+ %indvars.iv.next.112 = or i64 %indvars.iv, 2
+ %arrayidx.2 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.112
+ %2 = load double* %arrayidx.2, align 16, !tbaa !0
+ %add.2 = fadd double %2, 1.000000e+00
+ %arrayidx5.2 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.112
+ store double %add.2, double* %arrayidx5.2, align 16, !tbaa !0
+ %indvars.iv.next.213 = or i64 %indvars.iv, 3
+ %arrayidx.3 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.213
+ %3 = load double* %arrayidx.3, align 8, !tbaa !0
+ %add.3 = fadd double %3, 1.000000e+00
+ %arrayidx5.3 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.213
+ store double %add.3, double* %arrayidx5.3, align 8, !tbaa !0
+ %indvars.iv.next.314 = or i64 %indvars.iv, 4
+ %arrayidx.4 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.314
+ %4 = load double* %arrayidx.4, align 32, !tbaa !0
+ %add.4 = fadd double %4, 1.000000e+00
+ %arrayidx5.4 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.314
+ store double %add.4, double* %arrayidx5.4, align 32, !tbaa !0
+ %indvars.iv.next.415 = or i64 %indvars.iv, 5
+ %arrayidx.5 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.415
+ %5 = load double* %arrayidx.5, align 8, !tbaa !0
+ %add.5 = fadd double %5, 1.000000e+00
+ %arrayidx5.5 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.415
+ store double %add.5, double* %arrayidx5.5, align 8, !tbaa !0
+ %indvars.iv.next.516 = or i64 %indvars.iv, 6
+ %arrayidx.6 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.516
+ %6 = load double* %arrayidx.6, align 16, !tbaa !0
+ %add.6 = fadd double %6, 1.000000e+00
+ %arrayidx5.6 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.516
+ store double %add.6, double* %arrayidx5.6, align 16, !tbaa !0
+ %indvars.iv.next.617 = or i64 %indvars.iv, 7
+ %arrayidx.7 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.617
+ %7 = load double* %arrayidx.7, align 8, !tbaa !0
+ %add.7 = fadd double %7, 1.000000e+00
+ %arrayidx5.7 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.617
+ store double %add.7, double* %arrayidx5.7, align 8, !tbaa !0
+ %indvars.iv.next.718 = or i64 %indvars.iv, 8
+ %arrayidx.8 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.718
+ %8 = load double* %arrayidx.8, align 32, !tbaa !0
+ %add.8 = fadd double %8, 1.000000e+00
+ %arrayidx5.8 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.718
+ store double %add.8, double* %arrayidx5.8, align 32, !tbaa !0
+ %indvars.iv.next.819 = or i64 %indvars.iv, 9
+ %arrayidx.9 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.819
+ %9 = load double* %arrayidx.9, align 8, !tbaa !0
+ %add.9 = fadd double %9, 1.000000e+00
+ %arrayidx5.9 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.819
+ store double %add.9, double* %arrayidx5.9, align 8, !tbaa !0
+ %indvars.iv.next.920 = or i64 %indvars.iv, 10
+ %arrayidx.10 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.920
+ %10 = load double* %arrayidx.10, align 16, !tbaa !0
+ %add.10 = fadd double %10, 1.000000e+00
+ %arrayidx5.10 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.920
+ store double %add.10, double* %arrayidx5.10, align 16, !tbaa !0
+ %indvars.iv.next.1021 = or i64 %indvars.iv, 11
+ %arrayidx.11 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.1021
+ %11 = load double* %arrayidx.11, align 8, !tbaa !0
+ %add.11 = fadd double %11, 1.000000e+00
+ %arrayidx5.11 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.1021
+ store double %add.11, double* %arrayidx5.11, align 8, !tbaa !0
+ %indvars.iv.next.1122 = or i64 %indvars.iv, 12
+ %arrayidx.12 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.1122
+ %12 = load double* %arrayidx.12, align 32, !tbaa !0
+ %add.12 = fadd double %12, 1.000000e+00
+ %arrayidx5.12 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.1122
+ store double %add.12, double* %arrayidx5.12, align 32, !tbaa !0
+ %indvars.iv.next.1223 = or i64 %indvars.iv, 13
+ %arrayidx.13 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.1223
+ %13 = load double* %arrayidx.13, align 8, !tbaa !0
+ %add.13 = fadd double %13, 1.000000e+00
+ %arrayidx5.13 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.1223
+ store double %add.13, double* %arrayidx5.13, align 8, !tbaa !0
+ %indvars.iv.next.1324 = or i64 %indvars.iv, 14
+ %arrayidx.14 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.1324
+ %14 = load double* %arrayidx.14, align 16, !tbaa !0
+ %add.14 = fadd double %14, 1.000000e+00
+ %arrayidx5.14 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.1324
+ store double %add.14, double* %arrayidx5.14, align 16, !tbaa !0
+ %indvars.iv.next.1425 = or i64 %indvars.iv, 15
+ %arrayidx.15 = getelementptr inbounds [16000 x double]* @Y, i64 0, i64 %indvars.iv.next.1425
+ %15 = load double* %arrayidx.15, align 8, !tbaa !0
+ %add.15 = fadd double %15, 1.000000e+00
+ %arrayidx5.15 = getelementptr inbounds [16000 x double]* @X, i64 0, i64 %indvars.iv.next.1425
+ store double %add.15, double* %arrayidx5.15, align 8, !tbaa !0
+ %indvars.iv.next.15 = add i64 %indvars.iv, 16
+ %lftr.wideiv.15 = trunc i64 %indvars.iv.next.15 to i32
+ %exitcond.15 = icmp eq i32 %lftr.wideiv.15, 16000
+ br i1 %exitcond.15, label %for.end, label %for.body3
+
+for.end: ; preds = %for.body3
+ %call = tail call i32 @dummy(double* getelementptr inbounds ([16000 x double]* @X, i64 0, i64 0), double* getelementptr inbounds ([16000 x double]* @Y, i64 0, i64 0), double* getelementptr inbounds ([16000 x double]* @Z, i64 0, i64 0), double* getelementptr inbounds ([16000 x double]* @U, i64 0, i64 0), double* getelementptr inbounds ([16000 x double]* @V, i64 0, i64 0), [256 x double]* getelementptr inbounds ([256 x [256 x double]]* @aa, i64 0, i64 0), [256 x double]* getelementptr inbounds ([256 x [256 x double]]* @bb, i64 0, i64 0), [256 x double]* getelementptr inbounds ([256 x [256 x double]]* @cc, i64 0, i64 0), double 0.000000e+00) nounwind
+ %inc7 = add nsw i32 %nl.010, 1
+ %exitcond = icmp eq i32 %inc7, 400000
+ br i1 %exitcond, label %for.end8, label %for.cond1.preheader
+
+for.end8: ; preds = %for.end
+ ret i32 0
+
+; CHECK: @s000
+; CHECK: mtctr
+; CHECK: bdnz
+}
+
+declare i32 @dummy(double*, double*, double*, double*, double*, [256 x double]*, [256 x double]*, [256 x double]*, double)
+
+!0 = metadata !{metadata !"double", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
diff --git a/test/CodeGen/PowerPC/ctrloop-sums.ll b/test/CodeGen/PowerPC/ctrloop-sums.ll
new file mode 100644
index 0000000000..eae8c38eee
--- /dev/null
+++ b/test/CodeGen/PowerPC/ctrloop-sums.ll
@@ -0,0 +1,134 @@
+; ModuleID = 'SingleSource/Regression/C/sumarray2d.c'
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+; RUN: llc < %s -march=ppc64 | FileCheck %s
+
+@.str = private unnamed_addr constant [23 x i8] c"Sum(Array[%d,%d] = %d\0A\00", align 1
+
+define i32 @SumArray([100 x i32]* nocapture %Array, i32 %NumI, i32 %NumJ) nounwind readonly {
+entry:
+ %cmp12 = icmp eq i32 %NumI, 0
+ br i1 %cmp12, label %for.end8, label %for.cond1.preheader.lr.ph
+
+for.cond1.preheader.lr.ph: ; preds = %entry
+ %cmp29 = icmp eq i32 %NumJ, 0
+ br i1 %cmp29, label %for.inc6, label %for.body3.lr.ph.us
+
+for.inc6.us: ; preds = %for.body3.us
+ %indvars.iv.next17 = add i64 %indvars.iv16, 1
+ %lftr.wideiv18 = trunc i64 %indvars.iv.next17 to i32
+ %exitcond19 = icmp eq i32 %lftr.wideiv18, %NumI
+ br i1 %exitcond19, label %for.end8, label %for.body3.lr.ph.us
+
+for.body3.us: ; preds = %for.body3.us, %for.body3.lr.ph.us
+ %indvars.iv = phi i64 [ 0, %for.body3.lr.ph.us ], [ %indvars.iv.next, %for.body3.us ]
+ %Result.111.us = phi i32 [ %Result.014.us, %for.body3.lr.ph.us ], [ %add.us, %for.body3.us ]
+ %arrayidx5.us = getelementptr inbounds [100 x i32]* %Array, i64 %indvars.iv16, i64 %indvars.iv
+ %0 = load i32* %arrayidx5.us, align 4, !tbaa !0
+ %add.us = add nsw i32 %0, %Result.111.us
+ %indvars.iv.next = add i64 %indvars.iv, 1
+ %lftr.wideiv = trunc i64 %indvars.iv.next to i32
+ %exitcond = icmp eq i32 %lftr.wideiv, %NumJ
+ br i1 %exitcond, label %for.inc6.us, label %for.body3.us
+
+for.body3.lr.ph.us: ; preds = %for.inc6.us, %for.cond1.preheader.lr.ph
+ %indvars.iv16 = phi i64 [ %indvars.iv.next17, %for.inc6.us ], [ 0, %for.cond1.preheader.lr.ph ]
+ %Result.014.us = phi i32 [ %add.us, %for.inc6.us ], [ 0, %for.cond1.preheader.lr.ph ]
+ br label %for.body3.us
+
+for.inc6: ; preds = %for.inc6, %for.cond1.preheader.lr.ph
+ %i.013 = phi i32 [ %inc7, %for.inc6 ], [ 0, %for.cond1.preheader.lr.ph ]
+ %inc7 = add i32 %i.013, 1
+ %exitcond20 = icmp eq i32 %inc7, %NumI
+ br i1 %exitcond20, label %for.end8, label %for.inc6
+
+for.end8: ; preds = %for.inc6.us, %for.inc6, %entry
+ %Result.0.lcssa = phi i32 [ 0, %entry ], [ %add.us, %for.inc6.us ], [ 0, %for.inc6 ]
+ ret i32 %Result.0.lcssa
+; CHECK: @SumArray
+; CHECK: mtctr
+; CHECK: bdnz
+}
+
+define i32 @main() nounwind {
+entry:
+ %Array = alloca [100 x [100 x i32]], align 4
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %indvars.iv33 = phi i64 [ 0, %entry ], [ %indvars.iv.next34, %for.body ]
+ %0 = trunc i64 %indvars.iv33 to i32
+ %sub = sub i32 0, %0
+ %arrayidx2 = getelementptr inbounds [100 x [100 x i32]]* %Array, i64 0, i64 %indvars.iv33, i64 %indvars.iv33
+ store i32 %sub, i32* %arrayidx2, align 4, !tbaa !0
+ %indvars.iv.next34 = add i64 %indvars.iv33, 1
+ %lftr.wideiv35 = trunc i64 %indvars.iv.next34 to i32
+ %exitcond36 = icmp eq i32 %lftr.wideiv35, 100
+ br i1 %exitcond36, label %for.cond6.preheader, label %for.body
+
+for.cond6.preheader: ; preds = %for.body, %for.inc17
+ %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.inc17 ], [ 0, %for.body ]
+ br label %for.body8
+
+for.body8: ; preds = %for.inc14, %for.cond6.preheader
+ %indvars.iv = phi i64 [ 0, %for.cond6.preheader ], [ %indvars.iv.next, %for.inc14 ]
+ %1 = trunc i64 %indvars.iv to i32
+ %2 = trunc i64 %indvars.iv29 to i32
+ %cmp9 = icmp eq i32 %1, %2
+ br i1 %cmp9, label %for.inc14, label %if.then
+
+if.then: ; preds = %for.body8
+ %3 = add i64 %indvars.iv, %indvars.iv29
+ %arrayidx13 = getelementptr inbounds [100 x [100 x i32]]* %Array, i64 0, i64 %indvars.iv29, i64 %indvars.iv
+ %4 = trunc i64 %3 to i32
+ store i32 %4, i32* %arrayidx13, align 4, !tbaa !0
+ br label %for.inc14
+
+for.inc14: ; preds = %for.body8, %if.then
+ %indvars.iv.next = add i64 %indvars.iv, 1
+ %lftr.wideiv27 = trunc i64 %indvars.iv.next to i32
+ %exitcond28 = icmp eq i32 %lftr.wideiv27, 100
+ br i1 %exitcond28, label %for.inc17, label %for.body8
+
+for.inc17: ; preds = %for.inc14
+ %indvars.iv.next30 = add i64 %indvars.iv29, 1
+ %lftr.wideiv31 = trunc i64 %indvars.iv.next30 to i32
+ %exitcond32 = icmp eq i32 %lftr.wideiv31, 100
+ br i1 %exitcond32, label %for.body3.lr.ph.us.i, label %for.cond6.preheader
+
+for.inc6.us.i: ; preds = %for.body3.us.i
+ %indvars.iv.next17.i = add i64 %indvars.iv16.i, 1
+ %lftr.wideiv24 = trunc i64 %indvars.iv.next17.i to i32
+ %exitcond25 = icmp eq i32 %lftr.wideiv24, 100
+ br i1 %exitcond25, label %SumArray.exit, label %for.body3.lr.ph.us.i
+
+for.body3.us.i: ; preds = %for.body3.lr.ph.us.i, %for.body3.us.i
+ %indvars.iv.i = phi i64 [ 0, %for.body3.lr.ph.us.i ], [ %indvars.iv.next.i, %for.body3.us.i ]
+ %Result.111.us.i = phi i32 [ %Result.014.us.i, %for.body3.lr.ph.us.i ], [ %add.us.i, %for.body3.us.i ]
+ %arrayidx5.us.i = getelementptr inbounds [100 x [100 x i32]]* %Array, i64 0, i64 %indvars.iv16.i, i64 %indvars.iv.i
+ %5 = load i32* %arrayidx5.us.i, align 4, !tbaa !0
+ %add.us.i = add nsw i32 %5, %Result.111.us.i
+ %indvars.iv.next.i = add i64 %indvars.iv.i, 1
+ %lftr.wideiv = trunc i64 %indvars.iv.next.i to i32
+ %exitcond = icmp eq i32 %lftr.wideiv, 100
+ br i1 %exitcond, label %for.inc6.us.i, label %for.body3.us.i
+
+for.body3.lr.ph.us.i: ; preds = %for.inc17, %for.inc6.us.i
+ %indvars.iv16.i = phi i64 [ %indvars.iv.next17.i, %for.inc6.us.i ], [ 0, %for.inc17 ]
+ %Result.014.us.i = phi i32 [ %add.us.i, %for.inc6.us.i ], [ 0, %for.inc17 ]
+ br label %for.body3.us.i
+
+SumArray.exit: ; preds = %for.inc6.us.i
+ %call20 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([23 x i8]* @.str, i64 0, i64 0), i32 100, i32 100, i32 %add.us.i) nounwind
+ ret i32 0
+
+; CHECK: @main
+; CHECK: mtctr
+; CHECK: bdnz
+}
+
+declare i32 @printf(i8* nocapture, ...) nounwind
+
+!0 = metadata !{metadata !"int", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
diff --git a/test/CodeGen/PowerPC/darwin-labels.ll b/test/CodeGen/PowerPC/darwin-labels.ll
index af23369740..56f7782138 100644
--- a/test/CodeGen/PowerPC/darwin-labels.ll
+++ b/test/CodeGen/PowerPC/darwin-labels.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | grep {foo bar":}
+; RUN: llc < %s | grep 'foo bar":'
target datalayout = "E-p:32:32"
target triple = "powerpc-apple-darwin8.2.0"
diff --git a/test/CodeGen/PowerPC/fabs.ll b/test/CodeGen/PowerPC/fabs.ll
index 6ef740f835..156e00b4e5 100644
--- a/test/CodeGen/PowerPC/fabs.ll
+++ b/test/CodeGen/PowerPC/fabs.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | grep {fabs f1, f1}
+; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | grep "fabs f1, f1"
define double @fabs(double %f) {
entry:
diff --git a/test/CodeGen/PowerPC/fma.ll b/test/CodeGen/PowerPC/fma.ll
index 815c72c1f8..27496f7937 100644
--- a/test/CodeGen/PowerPC/fma.ll
+++ b/test/CodeGen/PowerPC/fma.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=ppc32 | \
-; RUN: egrep {fn?madd|fn?msub} | count 8
+; RUN: llc < %s -march=ppc32 -fp-contract=fast | \
+; RUN: egrep "fn?madd|fn?msub" | count 8
define double @test_FMADD1(double %A, double %B, double %C) {
%D = fmul double %A, %B ; <double> [#uses=1]
diff --git a/test/CodeGen/PowerPC/fsqrt.ll b/test/CodeGen/PowerPC/fsqrt.ll
index 74a8725eb1..bf8c4a22c9 100644
--- a/test/CodeGen/PowerPC/fsqrt.ll
+++ b/test/CodeGen/PowerPC/fsqrt.ll
@@ -2,13 +2,13 @@
; otherwise.
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
-; RUN: grep {fsqrt f1, f1}
+; RUN: grep "fsqrt f1, f1"
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
-; RUN: grep {fsqrt f1, f1}
+; RUN: grep "fsqrt f1, f1"
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
-; RUN: not grep {fsqrt f1, f1}
+; RUN: not grep "fsqrt f1, f1"
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
-; RUN: not grep {fsqrt f1, f1}
+; RUN: not grep "fsqrt f1, f1"
declare double @llvm.sqrt.f64(double)
diff --git a/test/CodeGen/PowerPC/iabs.ll b/test/CodeGen/PowerPC/iabs.ll
index a43f09c7d5..7d089bbd65 100644
--- a/test/CodeGen/PowerPC/iabs.ll
+++ b/test/CodeGen/PowerPC/iabs.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=ppc32 -stats |& \
-; RUN: grep {4 .*Number of machine instrs printed}
+; RUN: llc < %s -march=ppc32 -stats 2>&1 | \
+; RUN: grep "4 .*Number of machine instrs printed"
;; Integer absolute value, should produce something as good as:
;; srawi r2, r3, 31
diff --git a/test/CodeGen/PowerPC/isel.ll b/test/CodeGen/PowerPC/isel.ll
new file mode 100644
index 0000000000..ed494c57d3
--- /dev/null
+++ b/test/CodeGen/PowerPC/isel.ll
@@ -0,0 +1,23 @@
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+; RUN: llc -mcpu=a2 < %s | FileCheck %s
+; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
+
+define i64 @test1(i64 %a, i64 %b, i64 %c, i64 %d) {
+entry:
+ %p = icmp uge i64 %a, %b
+ %x = select i1 %p, i64 %c, i64 %d
+ ret i64 %x
+; CHECK: @test1
+; CHECK: isel
+}
+
+define i32 @test2(i32 %a, i32 %b, i32 %c, i32 %d) {
+entry:
+ %p = icmp uge i32 %a, %b
+ %x = select i1 %p, i32 %c, i32 %d
+ ret i32 %x
+; CHECK: @test2
+; CHECK: isel
+}
+
diff --git a/test/CodeGen/PowerPC/ispositive.ll b/test/CodeGen/PowerPC/ispositive.ll
index 4161e3438a..78cdf4a4d9 100644
--- a/test/CodeGen/PowerPC/ispositive.ll
+++ b/test/CodeGen/PowerPC/ispositive.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {srwi r3, r3, 31}
+; RUN: grep "srwi r3, r3, 31"
define i32 @test1(i32 %X) {
entry:
diff --git a/test/CodeGen/PowerPC/lbzux.ll b/test/CodeGen/PowerPC/lbzux.ll
new file mode 100644
index 0000000000..5725c0dddf
--- /dev/null
+++ b/test/CodeGen/PowerPC/lbzux.ll
@@ -0,0 +1,49 @@
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+; RUN: llc < %s | FileCheck %s
+
+define fastcc void @allocateSpace() nounwind {
+entry:
+ %0 = load i8** undef, align 8, !tbaa !0
+ br i1 undef, label %return, label %lor.lhs.false
+
+lor.lhs.false: ; preds = %entry
+ br i1 undef, label %if.end7, label %return
+
+if.end7: ; preds = %lor.lhs.false
+ br i1 undef, label %if.then15, label %if.end71
+
+if.then15: ; preds = %if.end7
+ br label %while.cond
+
+while.cond: ; preds = %while.body, %if.then15
+ %idxprom17 = sext i32 0 to i64
+ %arrayidx18 = getelementptr inbounds i8* %0, i64 %idxprom17
+ %or = or i32 undef, undef
+ br i1 false, label %if.end71, label %while.body
+
+while.body: ; preds = %while.cond
+ br i1 undef, label %while.cond, label %if.then45
+
+if.then45: ; preds = %while.body
+ %idxprom48139 = zext i32 %or to i64
+ %arrayidx49 = getelementptr inbounds i8* %0, i64 %idxprom48139
+ %1 = bitcast i8* %arrayidx49 to i16*
+ %2 = bitcast i8* %arrayidx18 to i16*
+ %3 = load i16* %1, align 1
+ store i16 %3, i16* %2, align 1
+ br label %return
+
+if.end71: ; preds = %while.cond, %if.end7
+ unreachable
+
+return: ; preds = %if.then45, %lor.lhs.false, %entry
+ ret void
+
+; CHECK: @allocateSpace
+; CHECK: lbzux
+}
+
+!0 = metadata !{metadata !"any pointer", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
diff --git a/test/CodeGen/PowerPC/long-compare.ll b/test/CodeGen/PowerPC/long-compare.ll
index 94c2526cf5..915595f6db 100644
--- a/test/CodeGen/PowerPC/long-compare.ll
+++ b/test/CodeGen/PowerPC/long-compare.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=ppc32 | grep cntlzw
; RUN: llc < %s -march=ppc32 | not grep xori
-; RUN: llc < %s -march=ppc32 | not grep {li }
-; RUN: llc < %s -march=ppc32 | not grep {mr }
+; RUN: llc < %s -march=ppc32 | not grep "li "
+; RUN: llc < %s -march=ppc32 | not grep "mr "
define i1 @test(i64 %x) {
%tmp = icmp ult i64 %x, 4294967296
diff --git a/test/CodeGen/PowerPC/lsr-postinc-pos.ll b/test/CodeGen/PowerPC/lsr-postinc-pos.ll
index f441e42da2..42472c58fe 100644
--- a/test/CodeGen/PowerPC/lsr-postinc-pos.ll
+++ b/test/CodeGen/PowerPC/lsr-postinc-pos.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -print-lsr-output |& FileCheck %s
+; RUN: llc < %s -print-lsr-output 2>&1 | FileCheck %s
; The icmp is a post-inc use, and the increment is in %bb11, but the
; scevgep needs to be inserted in %bb so that it is dominated by %t.
diff --git a/test/CodeGen/PowerPC/no-dead-strip.ll b/test/CodeGen/PowerPC/no-dead-strip.ll
index 3459413253..6320e2812c 100644
--- a/test/CodeGen/PowerPC/no-dead-strip.ll
+++ b/test/CodeGen/PowerPC/no-dead-strip.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | grep {no_dead_strip.*_X}
+; RUN: llc < %s | grep "no_dead_strip.*_X"
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 = "powerpc-apple-darwin8.8.0"
diff --git a/test/CodeGen/PowerPC/ppc440-fp-basic.ll b/test/CodeGen/PowerPC/ppc440-fp-basic.ll
index 1fad2fa3aa..77b726c5ae 100644
--- a/test/CodeGen/PowerPC/ppc440-fp-basic.ll
+++ b/test/CodeGen/PowerPC/ppc440-fp-basic.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc32 -mcpu=440 | FileCheck %s
+; RUN: llc < %s -march=ppc32 -mcpu=440 -fp-contract=fast | FileCheck %s
%0 = type { double, double }
diff --git a/test/CodeGen/PowerPC/retaddr.ll b/test/CodeGen/PowerPC/retaddr.ll
index cf16b4c26f..c931dfe935 100644
--- a/test/CodeGen/PowerPC/retaddr.ll
+++ b/test/CodeGen/PowerPC/retaddr.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=ppc32 | grep mflr
; RUN: llc < %s -march=ppc32 | grep lwz
-; RUN: llc < %s -march=ppc64 | grep {ld r., 16(r1)}
+; RUN: llc < %s -march=ppc64 | grep "ld r., 16(r1)"
target triple = "powerpc-apple-darwin8"
diff --git a/test/CodeGen/PowerPC/rlwimi-commute.ll b/test/CodeGen/PowerPC/rlwimi-commute.ll
index 6410c63234..3f90008c00 100644
--- a/test/CodeGen/PowerPC/rlwimi-commute.ll
+++ b/test/CodeGen/PowerPC/rlwimi-commute.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=ppc32 | grep rlwimi
-; RUN: llc < %s -march=ppc32 | not grep {or }
+; RUN: llc < %s -march=ppc32 | not grep "or "
; Make sure there is no register-register copies here.
diff --git a/test/CodeGen/PowerPC/rlwimi3.ll b/test/CodeGen/PowerPC/rlwimi3.ll
index 05d37bf162..7efdbe9634 100644
--- a/test/CodeGen/PowerPC/rlwimi3.ll
+++ b/test/CodeGen/PowerPC/rlwimi3.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=ppc32 -stats |& \
-; RUN: grep {Number of machine instrs printed} | grep 12
+; RUN: llc < %s -march=ppc32 -stats 2>&1 | \
+; RUN: grep "Number of machine instrs printed" | grep 12
define i16 @Trans16Bit(i32 %srcA, i32 %srcB, i32 %alpha) {
%tmp1 = shl i32 %srcA, 15 ; <i32> [#uses=1]
diff --git a/test/CodeGen/PowerPC/seteq-0.ll b/test/CodeGen/PowerPC/seteq-0.ll
index 688b29aa12..731958374e 100644
--- a/test/CodeGen/PowerPC/seteq-0.ll
+++ b/test/CodeGen/PowerPC/seteq-0.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
-; RUN: grep {srwi r., r., 5}
+; RUN: grep "srwi r., r., 5"
define i32 @eq0(i32 %a) {
%tmp.1 = icmp eq i32 %a, 0 ; <i1> [#uses=1]
diff --git a/test/CodeGen/PowerPC/small-arguments.ll b/test/CodeGen/PowerPC/small-arguments.ll
index b4767b0a29..19ca0985ee 100644
--- a/test/CodeGen/PowerPC/small-arguments.ll
+++ b/test/CodeGen/PowerPC/small-arguments.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc32 | not grep {extsh\\|rlwinm}
+; RUN: llc < %s -march=ppc32 | not grep "extsh\|rlwinm"
declare signext i16 @foo()
diff --git a/test/CodeGen/PowerPC/stack-protector.ll b/test/CodeGen/PowerPC/stack-protector.ll
index 2020361250..810630f697 100644
--- a/test/CodeGen/PowerPC/stack-protector.ll
+++ b/test/CodeGen/PowerPC/stack-protector.ll
@@ -1,5 +1,5 @@
-; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_guard}
-; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_fail}
+; RUN: llc -march=ppc32 < %s -o - | grep "__stack_chk_guard"
+; RUN: llc -march=ppc32 < %s -o - | grep "__stack_chk_fail"
@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1]
diff --git a/test/CodeGen/PowerPC/stwu-gta.ll b/test/CodeGen/PowerPC/stwu-gta.ll
new file mode 100644
index 0000000000..4febe7e2fe
--- /dev/null
+++ b/test/CodeGen/PowerPC/stwu-gta.ll
@@ -0,0 +1,22 @@
+target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32"
+target triple = "powerpc-unknown-linux"
+; RUN: llc < %s | FileCheck %s
+
+%class.Two.0.5 = type { i32, i32, i32 }
+
+@foo = external global %class.Two.0.5, align 4
+
+define void @_GLOBAL__I_a() nounwind section ".text.startup" {
+entry:
+ store i32 5, i32* getelementptr inbounds (%class.Two.0.5* @foo, i32 0, i32 0), align 4, !tbaa !0
+ store i32 6, i32* getelementptr inbounds (%class.Two.0.5* @foo, i32 0, i32 1), align 4, !tbaa !0
+ ret void
+}
+
+; CHECK: @_GLOBAL__I_a
+; CHECK-NOT: stwux
+; CHECK: stwu
+
+!0 = metadata !{metadata !"int", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
diff --git a/test/CodeGen/PowerPC/stwux.ll b/test/CodeGen/PowerPC/stwux.ll
new file mode 100644
index 0000000000..737e9d9f0e
--- /dev/null
+++ b/test/CodeGen/PowerPC/stwux.ll
@@ -0,0 +1,47 @@
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+; RUN: llc < %s | FileCheck %s
+
+@multvec_i = external unnamed_addr global [100 x i32], align 4
+
+define fastcc void @subs_STMultiExceptIntern() nounwind {
+entry:
+ br i1 undef, label %while.body.lr.ph, label %return
+
+while.body.lr.ph: ; preds = %entry
+ br label %while.body
+
+while.body: ; preds = %if.end12, %while.body.lr.ph
+ %i.0240 = phi i32 [ -1, %while.body.lr.ph ], [ %i.1, %if.end12 ]
+ br i1 undef, label %if.end12, label %if.then
+
+if.then: ; preds = %while.body
+ br label %if.end12
+
+if.end12: ; preds = %if.then, %while.body
+ %i.1 = phi i32 [ %i.0240, %while.body ], [ undef, %if.then ]
+ br i1 undef, label %while.body, label %while.end
+
+while.end: ; preds = %if.end12
+ br i1 undef, label %return, label %if.end15
+
+if.end15: ; preds = %while.end
+ %idxprom.i.i230 = sext i32 %i.1 to i64
+ %arrayidx18 = getelementptr inbounds [100 x i32]* @multvec_i, i64 0, i64 %idxprom.i.i230
+ store i32 0, i32* %arrayidx18, align 4
+ br i1 undef, label %while.body21, label %while.end90
+
+while.body21: ; preds = %if.end15
+ unreachable
+
+while.end90: ; preds = %if.end15
+ store i32 0, i32* %arrayidx18, align 4
+ br label %return
+
+return: ; preds = %while.end90, %while.end, %entry
+ ret void
+
+; CHECK: @subs_STMultiExceptIntern
+; CHECK: stwux
+}
+
diff --git a/test/CodeGen/PowerPC/trampoline.ll b/test/CodeGen/PowerPC/trampoline.ll
index 91b201146b..3ea46f50e0 100644
--- a/test/CodeGen/PowerPC/trampoline.ll
+++ b/test/CodeGen/PowerPC/trampoline.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=ppc32 | grep {__trampoline_setup}
+; RUN: llc < %s -march=ppc32 | grep "__trampoline_setup"
module asm "\09.lazy_reference .objc_class_name_NSImageRep"
module asm "\09.objc_class_name_NSBitmapImageRep=0"
diff --git a/test/CodeGen/Thumb/asmprinter-bug.ll b/test/CodeGen/Thumb/asmprinter-bug.ll
index f73f93d919..18e11baf44 100644
--- a/test/CodeGen/Thumb/asmprinter-bug.ll
+++ b/test/CodeGen/Thumb/asmprinter-bug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=thumbv6-apple-darwin10 | grep rsbs | grep {#0}
+; RUN: llc < %s -mtriple=thumbv6-apple-darwin10 | grep rsbs | grep "#0"
%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
%struct.__sFILEX = type opaque
diff --git a/test/CodeGen/Thumb/frame_thumb.ll b/test/CodeGen/Thumb/frame_thumb.ll
index 0cac7554be..6cc4dd12f6 100644
--- a/test/CodeGen/Thumb/frame_thumb.ll
+++ b/test/CodeGen/Thumb/frame_thumb.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -mtriple=thumb-apple-darwin \
-; RUN: -disable-fp-elim | not grep {r11}
+; RUN: -disable-fp-elim | not grep "r11"
; RUN: llc < %s -mtriple=thumb-linux-gnueabi \
-; RUN: -disable-fp-elim | not grep {r11}
+; RUN: -disable-fp-elim | not grep "r11"
define i32 @f() {
entry:
diff --git a/test/CodeGen/Thumb/iabs.ll b/test/CodeGen/Thumb/iabs.ll
index d03b5b2e3b..2e77660c45 100644
--- a/test/CodeGen/Thumb/iabs.ll
+++ b/test/CodeGen/Thumb/iabs.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=thumb -stats |& \
-; RUN: grep {4 .*Number of machine instrs printed}
+; RUN: llc < %s -march=thumb -stats 2>&1 | \
+; RUN: grep "4 .*Number of machine instrs printed"
;; Integer absolute value, should produce something as good as:
;; Thumb:
diff --git a/test/CodeGen/Thumb2/2010-01-06-TailDuplicateLabels.ll b/test/CodeGen/Thumb2/2010-01-06-TailDuplicateLabels.ll
index af7d716446..348e9d3f20 100644
--- a/test/CodeGen/Thumb2/2010-01-06-TailDuplicateLabels.ll
+++ b/test/CodeGen/Thumb2/2010-01-06-TailDuplicateLabels.ll
@@ -1,4 +1,4 @@
-; RUN: llc -relocation-model=pic < %s | grep {:$} | sort | uniq -d | count 0
+; RUN: llc -relocation-model=pic < %s | grep ":$" | sort | uniq -d | count 0
target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
target triple = "thumbv7-apple-darwin10"
diff --git a/test/CodeGen/Thumb2/thumb2-ldr_post.ll b/test/CodeGen/Thumb2/thumb2-ldr_post.ll
index d1af4ba47f..2178eecb43 100644
--- a/test/CodeGen/Thumb2/thumb2-ldr_post.ll
+++ b/test/CodeGen/Thumb2/thumb2-ldr_post.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
-; RUN: grep {ldr.*\\\[.*\],} | count 1
+; RUN: grep "ldr.*\[.*\]," | count 1
define i32 @test(i32 %a, i32 %b, i32 %c) {
%tmp1 = mul i32 %a, %b ; <i32> [#uses=2]
diff --git a/test/CodeGen/Thumb2/thumb2-ldr_pre.ll b/test/CodeGen/Thumb2/thumb2-ldr_pre.ll
index 9cc3f4a2ed..601c0b5608 100644
--- a/test/CodeGen/Thumb2/thumb2-ldr_pre.ll
+++ b/test/CodeGen/Thumb2/thumb2-ldr_pre.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
-; RUN: grep {ldr.*\\!} | count 3
+; RUN: grep "ldr.*\!" | count 3
; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
-; RUN: grep {ldrsb.*\\!} | count 1
+; RUN: grep "ldrsb.*\!" | count 1
define i32* @test1(i32* %X, i32* %dest) {
%Y = getelementptr i32* %X, i32 4 ; <i32*> [#uses=2]
diff --git a/test/CodeGen/Thumb2/thumb2-rev16.ll b/test/CodeGen/Thumb2/thumb2-rev16.ll
index 39b6ac3f00..10cd5391a4 100644
--- a/test/CodeGen/Thumb2/thumb2-rev16.ll
+++ b/test/CodeGen/Thumb2/thumb2-rev16.ll
@@ -1,7 +1,7 @@
; XFAIL: *
; fixme rev16 pattern is not matching
-; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep {rev16\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
+; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep "rev16\W*r[0-9]*,\W*r[0-9]*" | count 1
; 0xff00ff00 = 4278255360
; 0x00ff00ff = 16711935
diff --git a/test/CodeGen/Thumb2/thumb2-ror.ll b/test/CodeGen/Thumb2/thumb2-ror.ll
index 590c333b3d..5ad92cd729 100644
--- a/test/CodeGen/Thumb2/thumb2-ror.ll
+++ b/test/CodeGen/Thumb2/thumb2-ror.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s
-
+; RUN: llc < %s -march=thumb | FileCheck %s -check-prefix=THUMB1
; CHECK: f1:
; CHECK: ror.w r0, r0, #22
@@ -13,6 +13,8 @@ define i32 @f1(i32 %a) {
; CHECK: f2:
; CHECK-NOT: and
; CHECK: ror
+; THUMB1: f2
+; THUMB1: and
define i32 @f2(i32 %v, i32 %nbits) {
entry:
%and = and i32 %nbits, 31
@@ -21,4 +23,4 @@ entry:
%shl = shl i32 %v, %sub
%or = or i32 %shl, %shr
ret i32 %or
-} \ No newline at end of file
+}
diff --git a/test/CodeGen/Thumb2/tls1.ll b/test/CodeGen/Thumb2/tls1.ll
index 1e555571c0..d91e3b32f9 100644
--- a/test/CodeGen/Thumb2/tls1.ll
+++ b/test/CodeGen/Thumb2/tls1.ll
@@ -1,9 +1,9 @@
; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi | \
-; RUN: grep {i(tpoff)}
+; RUN: grep "i(tpoff)"
; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi | \
-; RUN: grep {__aeabi_read_tp}
+; RUN: grep "__aeabi_read_tp"
; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi \
-; RUN: -relocation-model=pic | grep {__tls_get_addr}
+; RUN: -relocation-model=pic | grep "__tls_get_addr"
@i = thread_local global i32 15 ; <i32*> [#uses=2]
diff --git a/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll b/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll
index 24848602ba..0af2445d7f 100644
--- a/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll
+++ b/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll
@@ -3,7 +3,7 @@
; it makes a ton of annoying overlapping live ranges. This code should not
; cause spills!
;
-; RUN: llc < %s -march=x86 -stats |& not grep spilled
+; RUN: llc < %s -march=x86 -stats 2>&1 | not grep spilled
target datalayout = "e-p:32:32"
diff --git a/test/CodeGen/X86/2003-11-03-GlobalBool.ll b/test/CodeGen/X86/2003-11-03-GlobalBool.ll
index 8b0a18550d..f201b981a8 100644
--- a/test/CodeGen/X86/2003-11-03-GlobalBool.ll
+++ b/test/CodeGen/X86/2003-11-03-GlobalBool.ll
@@ -1,4 +1,4 @@
; RUN: llc < %s -march=x86 | \
-; RUN: not grep {.byte\[\[:space:\]\]*true}
+; RUN: not grep ".byte[[:space:]]*true"
@X = global i1 true ; <i1*> [#uses=0]
diff --git a/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll b/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll
index fea2b54d76..dde210b776 100644
--- a/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll
+++ b/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll
@@ -1,6 +1,6 @@
-; RUN: llc < %s -march=x86 | grep {(%esp}
-; RUN: llc < %s -march=x86 | grep {pushl %ebp} | count 1
-; RUN: llc < %s -march=x86 | grep {popl %ebp} | count 1
+; RUN: llc < %s -march=x86 | grep "(%esp"
+; RUN: llc < %s -march=x86 | grep "pushl %ebp" | count 1
+; RUN: llc < %s -march=x86 | grep "popl %ebp" | count 1
declare i8* @llvm.returnaddress(i32)
diff --git a/test/CodeGen/X86/2004-03-30-Select-Max.ll b/test/CodeGen/X86/2004-03-30-Select-Max.ll
index c44d10ac5b..526b0b206a 100644
--- a/test/CodeGen/X86/2004-03-30-Select-Max.ll
+++ b/test/CodeGen/X86/2004-03-30-Select-Max.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mcpu=yonah | not grep {j\[lgbe\]}
+; RUN: llc < %s -march=x86 -mcpu=yonah | not grep "j[lgbe]"
define i32 @max(i32 %A, i32 %B) nounwind {
%gt = icmp sgt i32 %A, %B ; <i1> [#uses=1]
diff --git a/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll b/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
index dc69ef8310..f8bf0991fb 100644
--- a/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
+++ b/test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | not grep {subl.*%esp}
+; RUN: llc < %s -march=x86 | not grep "subl.*%esp"
define i32 @f(i32 %a, i32 %b) {
%tmp.2 = mul i32 %a, %a ; <i32> [#uses=1]
diff --git a/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll b/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll
index 0421896922..1a3d74918d 100644
--- a/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll
+++ b/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -stats |& \
+; RUN: llc < %s -march=x86 -stats 2>&1 | \
; RUN: grep asm-printer | grep 7
define i32 @g(i32 %a, i32 %b) nounwind {
diff --git a/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll b/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
index 8783a11c06..fb1262a372 100644
--- a/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
+++ b/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static > %t
-; RUN: grep {movl _last} %t | count 1
-; RUN: grep {cmpl.*_last} %t | count 1
+; RUN: grep "movl _last" %t | count 1
+; RUN: grep "cmpl.*_last" %t | count 1
@block = external global i8* ; <i8**> [#uses=1]
@last = external global i32 ; <i32*> [#uses=3]
diff --git a/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll b/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll
index b045329966..5cba3efeef 100644
--- a/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll
+++ b/test/CodeGen/X86/2006-05-01-SchedCausingSpills.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=x86 -mcpu=yonah -stats |& \
-; RUN: not grep {Number of register spills}
+; RUN: llc < %s -march=x86 -mcpu=yonah -stats 2>&1 | \
+; RUN: not grep "Number of register spills"
; END.
diff --git a/test/CodeGen/X86/2006-05-02-InstrSched1.ll b/test/CodeGen/X86/2006-05-02-InstrSched1.ll
index 7d0a6ab0a0..1c75f93915 100644
--- a/test/CodeGen/X86/2006-05-02-InstrSched1.ll
+++ b/test/CodeGen/X86/2006-05-02-InstrSched1.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -relocation-model=static -stats |& \
+; RUN: llc < %s -march=x86 -relocation-model=static -stats 2>&1 | \
; RUN: grep asm-printer | grep 14
;
@size20 = external global i32 ; <i32*> [#uses=1]
diff --git a/test/CodeGen/X86/2006-05-02-InstrSched2.ll b/test/CodeGen/X86/2006-05-02-InstrSched2.ll
index 23954d76a5..95eefa1e71 100644
--- a/test/CodeGen/X86/2006-05-02-InstrSched2.ll
+++ b/test/CodeGen/X86/2006-05-02-InstrSched2.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -stats |& \
+; RUN: llc < %s -march=x86 -stats 2>&1 | \
; RUN: grep asm-printer | grep 13
define void @_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(i8* %tmp435.i, i32* %tmp449.i.out) nounwind {
diff --git a/test/CodeGen/X86/2006-05-08-InstrSched.ll b/test/CodeGen/X86/2006-05-08-InstrSched.ll
index d58d638562..3419d01fa0 100644
--- a/test/CodeGen/X86/2006-05-08-InstrSched.ll
+++ b/test/CodeGen/X86/2006-05-08-InstrSched.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -relocation-model=static | not grep {subl.*%esp}
+; RUN: llc < %s -march=x86 -relocation-model=static | not grep "subl.*%esp"
@A = external global i16* ; <i16**> [#uses=1]
@B = external global i32 ; <i32*> [#uses=1]
diff --git a/test/CodeGen/X86/2006-05-11-InstrSched.ll b/test/CodeGen/X86/2006-05-11-InstrSched.ll
index d47840e866..37c510786a 100644
--- a/test/CodeGen/X86/2006-05-11-InstrSched.ll
+++ b/test/CodeGen/X86/2006-05-11-InstrSched.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mcpu=penryn -mattr=+sse2 -stats -realign-stack=0 |&\
-; RUN: grep {asm-printer} | grep 35
+; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mcpu=penryn -mattr=+sse2 -stats -realign-stack=0 2>&1 | \
+; RUN: grep "asm-printer" | grep 35
target datalayout = "e-p:32:32"
define void @foo(i32* %mc, i32* %bp, i32* %ms, i32* %xmb, i32* %mpp, i32* %tpmm, i32* %ip, i32* %tpim, i32* %dpp, i32* %tpdm, i32* %bpi, i32 %M) nounwind {
diff --git a/test/CodeGen/X86/2006-07-31-SingleRegClass.ll b/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
index 3159cec855..c5c74d1048 100644
--- a/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
+++ b/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
@@ -1,7 +1,7 @@
; PR850
; RUN: llc < %s -march=x86 -x86-asm-syntax=att > %t
-; RUN: grep {movl 4(%eax),%ebp} %t
-; RUN: grep {movl 0(%eax), %ebx} %t
+; RUN: grep "movl 4(%eax),%ebp" %t
+; RUN: grep "movl 0(%eax), %ebx" %t
define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
%tmp9.i.i = call i32 asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint $$0x80\0Apop %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"( i32 192, i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i ) ; <i32> [#uses=1]
diff --git a/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll b/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll
index a19d8f7092..56d5f2f304 100644
--- a/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll
+++ b/test/CodeGen/X86/2006-08-21-ExtraMovInst.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 -mcpu=i386 | \
-; RUN: not grep {movl %eax, %edx}
+; RUN: not grep "movl %eax, %edx"
define i32 @foo(i32 %t, i32 %C) {
entry:
diff --git a/test/CodeGen/X86/2006-11-17-IllegalMove.ll b/test/CodeGen/X86/2006-11-17-IllegalMove.ll
index affb7afb1c..adc825c039 100644
--- a/test/CodeGen/X86/2006-11-17-IllegalMove.ll
+++ b/test/CodeGen/X86/2006-11-17-IllegalMove.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=x86-64 > %t
; RUN: grep movb %t | count 2
-; RUN: grep {movzb\[wl\]} %t
+; RUN: grep "movzb[wl]" %t
define void @handle_vector_size_attribute() nounwind {
diff --git a/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll b/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
index a228898636..04d4b8ee57 100644
--- a/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
+++ b/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86-64 > %t
-; RUN: not grep {,%rsp)} %t
+; RUN: not grep ",%rsp)" %t
; PR1103
target datalayout = "e-p:64:64"
diff --git a/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll b/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
index 3312e01b3d..3b2e443d7d 100644
--- a/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
+++ b/test/CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep {mov %gs:72, %eax}
+; RUN: llc < %s -march=x86 | grep "mov %gs:72, %eax"
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin9"
diff --git a/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll b/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
index c1b1ad1c73..18b06dc085 100644
--- a/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
+++ b/test/CodeGen/X86/2007-03-24-InlineAsmVectorOp.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mcpu=yonah -march=x86 | \
-; RUN: grep {cmpltsd %xmm0, %xmm0}
+; RUN: grep "cmpltsd %xmm0, %xmm0"
target datalayout = "e-p:32:32"
target triple = "i686-apple-darwin9"
diff --git a/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll b/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll
index 85a2ecc959..cae68c9f3a 100644
--- a/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll
+++ b/test/CodeGen/X86/2007-04-27-InlineAsm-IntMemInput.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | not grep {bsrl.*10}
+; RUN: llc < %s | not grep "bsrl.*10"
; PR1356
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/2007-05-07-InvokeSRet.ll b/test/CodeGen/X86/2007-05-07-InvokeSRet.ll
index deb39998a3..c3d7e8a054 100644
--- a/test/CodeGen/X86/2007-05-07-InvokeSRet.ll
+++ b/test/CodeGen/X86/2007-05-07-InvokeSRet.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i686-pc-linux-gnu -disable-fp-elim | not grep {addl .12, %esp}
+; RUN: llc < %s -mtriple=i686-pc-linux-gnu -disable-fp-elim | not grep "addl .12, %esp"
; PR1398
%struct.S = type { i32, i32 }
diff --git a/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll b/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
index 77291f063b..aa0ee5d074 100644
--- a/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
+++ b/test/CodeGen/X86/2007-08-10-SignExtSubreg.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep {movsbl}
+; RUN: llc < %s -march=x86 | grep "movsbl"
@X = global i32 0 ; <i32*> [#uses=1]
diff --git a/test/CodeGen/X86/2007-09-05-InvalidAsm.ll b/test/CodeGen/X86/2007-09-05-InvalidAsm.ll
index 5acb05134c..88186cd6fa 100644
--- a/test/CodeGen/X86/2007-09-05-InvalidAsm.ll
+++ b/test/CodeGen/X86/2007-09-05-InvalidAsm.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-apple-darwin -x86-asm-syntax=intel | not grep {lea\[\[:space:\]\]R}
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -x86-asm-syntax=intel | not grep "lea[[:space:]]R"
%struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* }
%struct.AGenericManager = type <{ i8 }>
diff --git a/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll b/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
index 228a915e3e..56a109acfc 100644
--- a/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
+++ b/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -relocation-model=static | grep {foo str$}
+; RUN: llc < %s -relocation-model=static | grep "foo str$"
; PR1761
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-pc-linux"
diff --git a/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll b/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll
index 2e95082afa..99df20da25 100644
--- a/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll
+++ b/test/CodeGen/X86/2007-12-18-LoadCSEBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mcpu=generic | grep {(%esp)} | count 2
+; RUN: llc < %s -march=x86 -mcpu=generic | grep "(%esp)" | count 2
; PR1872
%struct.c34007g__designated___XUB = type { i32, i32, i32, i32 }
diff --git a/test/CodeGen/X86/2008-02-18-TailMergingBug.ll b/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
index bdacf50711..a1b973d7cc 100644
--- a/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
+++ b/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 16
+; RUN: llc < %s -march=x86 -mcpu=yonah -stats 2>&1 | grep "Number of block tails merged" | grep 16
; PR1909
@.str = internal constant [48 x i8] c"transformed bounds: (%.2f, %.2f), (%.2f, %.2f)\0A\00" ; <[48 x i8]*> [#uses=1]
diff --git a/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll b/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
index 5115e48365..a52b36588a 100644
--- a/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
+++ b/test/CodeGen/X86/2008-02-20-InlineAsmClobber.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s | grep {a:} | not grep ax
-; RUN: llc < %s | grep {b:} | not grep ax
+; RUN: llc < %s | grep "a:" | not grep ax
+; RUN: llc < %s | grep "b:" | not grep ax
; PR2078
; The clobber list says that "ax" is clobbered. Make sure that eax isn't
; allocated to the input/output register.
diff --git a/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll b/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll
index 4dc3a10f46..5ca7e3ed3d 100644
--- a/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll
+++ b/test/CodeGen/X86/2008-03-23-DarwinAsmComments.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin -asm-verbose | grep {#} | not grep -v {##}
+; RUN: llc < %s -mtriple=i386-apple-darwin -asm-verbose | grep "#" | not grep -v "##"
%struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* }
%struct.AGenericManager = type <{ i8 }>
diff --git a/test/CodeGen/X86/2008-04-16-ReMatBug.ll b/test/CodeGen/X86/2008-04-16-ReMatBug.ll
index 109069e353..3a1de11ea2 100644
--- a/test/CodeGen/X86/2008-04-16-ReMatBug.ll
+++ b/test/CodeGen/X86/2008-04-16-ReMatBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin -disable-cgp-branch-opts | grep movw | not grep {, %e}
+; RUN: llc < %s -mtriple=i386-apple-darwin -disable-cgp-branch-opts | grep movw | not grep ", %e"
%struct.DBC_t = type { i32, i8*, i16, %struct.DBC_t*, i8*, i8*, i8*, i8*, i8*, %struct.DBC_t*, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32*, i8, i16, %struct.DRVOPT*, i16 }
%struct.DRVOPT = type { i16, i32, i8, %struct.DRVOPT* }
diff --git a/test/CodeGen/X86/2008-04-17-CoalescerBug.ll b/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
index 859041eb81..f244793e7a 100644
--- a/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
+++ b/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin | grep xorl | grep {%e}
+; RUN: llc < %s -mtriple=i386-apple-darwin | grep xorl | grep "%e"
; Make sure xorl operands are 32-bit registers.
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* }
diff --git a/test/CodeGen/X86/2008-04-28-CoalescerBug.ll b/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
index 5b97eb71cb..7c04206de7 100644
--- a/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
+++ b/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep movl > %t
-; RUN: not grep {r\[abcd\]x} %t
-; RUN: not grep {r\[ds\]i} %t
-; RUN: not grep {r\[bs\]p} %t
+; RUN: not grep "r[abcd]x" %t
+; RUN: not grep "r[ds]i" %t
+; RUN: not grep "r[bs]p" %t
%struct.BITMAP = type { i16, i16, i32, i32, i32, i32, i32, i32, i8*, i8* }
%struct.BltData = type { float, float, float, float }
diff --git a/test/CodeGen/X86/2008-08-06-CmpStride.ll b/test/CodeGen/X86/2008-08-06-CmpStride.ll
index 99cb8569b3..bdac8fd484 100644
--- a/test/CodeGen/X86/2008-08-06-CmpStride.ll
+++ b/test/CodeGen/X86/2008-08-06-CmpStride.ll
@@ -1,4 +1,4 @@
-; RUN: llc -march=x86-64 < %s -o - | grep {cmpl \\$\[1\], %}
+; RUN: llc -march=x86-64 < %s -o - | grep "cmpl \$[1], %"
@.str = internal constant [4 x i8] c"%d\0A\00"
diff --git a/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll b/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll
index 1d27fc53ea..c63c890add 100644
--- a/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll
+++ b/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll
@@ -1,15 +1,36 @@
; Check that eh_return & unwind_init were properly lowered
-; RUN: llc < %s | grep %ebp | count 9
-; RUN: llc < %s | grep %ecx | count 5
+; RUN: llc < %s -verify-machineinstrs | FileCheck %s
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-pc-linux"
-define i8* @test(i32 %a, i8* %b) {
+; CHECK: test1
+; CHECK: pushl %ebp
+define i8* @test1(i32 %a, i8* %b) {
entry:
call void @llvm.eh.unwind.init()
%foo = alloca i32
call void @llvm.eh.return.i32(i32 %a, i8* %b)
+; CHECK: movl 12(%ebp), %[[ECX:e..]]
+; CHECK: movl 8(%ebp), %[[EAX:e..]]
+; CHECK: movl %[[ECX]], 4(%ebp,%[[EAX]])
+; CHECK: leal 4(%ebp,%[[EAX]]), %[[ECX2:e..]]
+; CHECK: movl %[[ECX2]], %esp
+; CHECK: ret
+ unreachable
+}
+
+; CHECK: test2
+; CHECK: pushl %ebp
+define i8* @test2(i32 %a, i8* %b) {
+entry:
+ call void @llvm.eh.return.i32(i32 %a, i8* %b)
+; CHECK: movl 12(%ebp), %[[ECX:e..]]
+; CHECK: movl 8(%ebp), %[[EAX:e..]]
+; CHECK: movl %[[ECX]], 4(%ebp,%[[EAX]])
+; CHECK: leal 4(%ebp,%[[EAX]]), %[[ECX2:e..]]
+; CHECK: movl %[[ECX2]], %esp
+; CHECK: ret
unreachable
}
diff --git a/test/CodeGen/X86/2008-10-24-FlippedCompare.ll b/test/CodeGen/X86/2008-10-24-FlippedCompare.ll
index 421b931ecd..e504bc3e77 100644
--- a/test/CodeGen/X86/2008-10-24-FlippedCompare.ll
+++ b/test/CodeGen/X86/2008-10-24-FlippedCompare.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 -o - | not grep {ucomiss\[^,\]*esp}
+; RUN: llc < %s -march=x86 -mattr=+sse2 -o - | not grep "ucomiss[^,]*esp"
define void @f(float %wt) {
entry:
diff --git a/test/CodeGen/X86/2008-10-27-CoalescerBug.ll b/test/CodeGen/X86/2008-10-27-CoalescerBug.ll
index 9d144a4be0..66f06778bd 100644
--- a/test/CodeGen/X86/2008-10-27-CoalescerBug.ll
+++ b/test/CodeGen/X86/2008-10-27-CoalescerBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -stats |& FileCheck %s
+; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -stats 2>&1 | FileCheck %s
; Now this test spills one register. But a reload in the loop is cheaper than
; the divsd so it's a win.
diff --git a/test/CodeGen/X86/2008-12-23-crazy-address.ll b/test/CodeGen/X86/2008-12-23-crazy-address.ll
index 2edcaea80c..0e95c9e34e 100644
--- a/test/CodeGen/X86/2008-12-23-crazy-address.ll
+++ b/test/CodeGen/X86/2008-12-23-crazy-address.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -relocation-model=static | grep {lea.*X.*esp} | count 2
+; RUN: llc < %s -march=x86 -relocation-model=static | grep "lea.*X.*esp" | count 2
@X = external global [0 x i32]
diff --git a/test/CodeGen/X86/2009-01-31-BigShift2.ll b/test/CodeGen/X86/2009-01-31-BigShift2.ll
index 3e425536d1..b478f27a95 100644
--- a/test/CodeGen/X86/2009-01-31-BigShift2.ll
+++ b/test/CodeGen/X86/2009-01-31-BigShift2.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep {mov.*56}
+; RUN: llc < %s -march=x86 | grep "mov.*56"
; PR3449
define void @test(<8 x double>* %P, i64* %Q) nounwind {
diff --git a/test/CodeGen/X86/2009-02-25-CommuteBug.ll b/test/CodeGen/X86/2009-02-25-CommuteBug.ll
index 7ea699833b..9cbf350940 100644
--- a/test/CodeGen/X86/2009-02-25-CommuteBug.ll
+++ b/test/CodeGen/X86/2009-02-25-CommuteBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& not grep commuted
+; RUN: llc < %s -march=x86 -mattr=+sse2 -stats 2>&1 | not grep commuted
; rdar://6608609
define <2 x double> @t(<2 x double> %A, <2 x double> %B, <2 x double> %C) nounwind readnone {
diff --git a/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll b/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll
index 8ac2b4e051..1b2f20303b 100644
--- a/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll
+++ b/test/CodeGen/X86/2009-02-26-MachineLICMBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -mcpu=penryn -stats |& grep {8 machine-licm}
+; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -mcpu=penryn -stats 2>&1 | grep "8 machine-licm"
; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -mcpu=penryn | FileCheck %s
; rdar://6627786
; rdar://7792037
diff --git a/test/CodeGen/X86/2009-03-12-CPAlignBug.ll b/test/CodeGen/X86/2009-03-12-CPAlignBug.ll
index 3564f01a7c..847a43fb06 100644
--- a/test/CodeGen/X86/2009-03-12-CPAlignBug.ll
+++ b/test/CodeGen/X86/2009-03-12-CPAlignBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 | not grep {.space}
+; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 | not grep ".space"
; rdar://6668548
declare double @llvm.sqrt.f64(double) nounwind readonly
diff --git a/test/CodeGen/X86/2009-03-23-MultiUseSched.ll b/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
index 8bbdb0e82f..d934ec9a88 100644
--- a/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
+++ b/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -mtriple=x86_64-linux -relocation-model=static -o /dev/null -stats -info-output-file - > %t
; RUN: not grep spill %t
-; RUN: not grep {%rsp} %t
-; RUN: not grep {%rbp} %t
+; RUN: not grep "%rsp" %t
+; RUN: not grep "%rbp" %t
; The register-pressure scheduler should be able to schedule this in a
; way that does not require spills.
diff --git a/test/CodeGen/X86/2009-04-16-SpillerUnfold.ll b/test/CodeGen/X86/2009-04-16-SpillerUnfold.ll
index f46eed4769..ad18a0c5b9 100644
--- a/test/CodeGen/X86/2009-04-16-SpillerUnfold.ll
+++ b/test/CodeGen/X86/2009-04-16-SpillerUnfold.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim -stats |& grep {Number of modref unfolded}
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim -stats 2>&1 | grep "Number of modref unfolded"
; XFAIL: *
; 69408 removed the opportunity for this optimization to work
diff --git a/test/CodeGen/X86/2009-04-24.ll b/test/CodeGen/X86/2009-04-24.ll
index 5f5bf06a2f..08bf9e3f9f 100644
--- a/test/CodeGen/X86/2009-04-24.ll
+++ b/test/CodeGen/X86/2009-04-24.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -regalloc=fast -optimize-regalloc=0 -relocation-model=pic > %t2
-; RUN: grep {leaq.*TLSGD} %t2
-; RUN: grep {__tls_get_addr} %t2
+; RUN: grep "leaq.*TLSGD" %t2
+; RUN: grep "__tls_get_addr" %t2
; PR4004
@i = thread_local global i32 15
diff --git a/test/CodeGen/X86/2009-04-29-IndirectDestOperands.ll b/test/CodeGen/X86/2009-04-29-IndirectDestOperands.ll
index a2fd2e4c51..a6ed74ba2e 100644
--- a/test/CodeGen/X86/2009-04-29-IndirectDestOperands.ll
+++ b/test/CodeGen/X86/2009-04-29-IndirectDestOperands.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | grep {movl.*%ebx, 8(%esi)}
+; RUN: llc < %s | grep "movl.*%ebx, 8(%esi)"
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-f80:128:128"
target triple = "i386-apple-darwin9.0"
diff --git a/test/CodeGen/X86/2009-05-30-ISelBug.ll b/test/CodeGen/X86/2009-05-30-ISelBug.ll
index af552d4ce2..fe04272082 100644
--- a/test/CodeGen/X86/2009-05-30-ISelBug.ll
+++ b/test/CodeGen/X86/2009-05-30-ISelBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86-64 | not grep {movzbl %\[abcd\]h,}
+; RUN: llc < %s -march=x86-64 | not grep "movzbl %[abcd]h,"
define void @BZ2_bzDecompress_bb5_2E_outer_bb35_2E_i_bb54_2E_i(i32*, i32 %c_nblock_used.2.i, i32 %.reload51, i32* %.out, i32* %.out1, i32* %.out2, i32* %.out3) nounwind {
newFuncRoot:
diff --git a/test/CodeGen/X86/20090313-signext.ll b/test/CodeGen/X86/20090313-signext.ll
index de930d5126..b8effa6773 100644
--- a/test/CodeGen/X86/20090313-signext.ll
+++ b/test/CodeGen/X86/20090313-signext.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=x86-64 -relocation-model=pic > %t
-; RUN: grep {movswl %ax, %edi} %t
-; RUN: grep {movw (%rax), %ax} %t
+; RUN: grep "movswl %ax, %edi" %t
+; RUN: grep "movw (%rax), %ax" %t
; XFAIL: *
@x = common global i16 0
diff --git a/test/CodeGen/X86/2010-01-19-OptExtBug.ll b/test/CodeGen/X86/2010-01-19-OptExtBug.ll
index cd8960b9ed..eb4a5c04a2 100644
--- a/test/CodeGen/X86/2010-01-19-OptExtBug.ll
+++ b/test/CodeGen/X86/2010-01-19-OptExtBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-apple-darwin11 -relocation-model=pic -disable-fp-elim -stats |& not grep ext-opt
+; RUN: llc < %s -mtriple=x86_64-apple-darwin11 -relocation-model=pic -disable-fp-elim -stats 2>&1 | not grep ext-opt
define fastcc i8* @S_scan_str(i8* %start, i32 %keep_quoted, i32 %keep_delims) nounwind ssp {
entry:
diff --git a/test/CodeGen/X86/2011-06-12-FastAllocSpill.ll b/test/CodeGen/X86/2011-06-12-FastAllocSpill.ll
index a51dad0303..47ef693cc2 100644
--- a/test/CodeGen/X86/2011-06-12-FastAllocSpill.ll
+++ b/test/CodeGen/X86/2011-06-12-FastAllocSpill.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -O0 -disable-fp-elim -relocation-model=pic -stats |& FileCheck %s
+; RUN: llc < %s -O0 -disable-fp-elim -relocation-model=pic -stats 2>&1 | FileCheck %s
;
; This test should not cause any spilling with RAFast.
;
diff --git a/test/CodeGen/X86/2012-03-26-PostRALICMBug.ll b/test/CodeGen/X86/2012-03-26-PostRALICMBug.ll
index 101eccabbd..18a3313773 100644
--- a/test/CodeGen/X86/2012-03-26-PostRALICMBug.ll
+++ b/test/CodeGen/X86/2012-03-26-PostRALICMBug.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -stats |& \
-; RUN: not grep {Number of machine instructions hoisted out of loops post regalloc}
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -stats 2>&1 | \
+; RUN: not grep "Number of machine instructions hoisted out of loops post regalloc"
; rdar://11095580
diff --git a/test/CodeGen/X86/MachineSink-PHIUse.ll b/test/CodeGen/X86/MachineSink-PHIUse.ll
index 3758fd8ce5..33141680aa 100644
--- a/test/CodeGen/X86/MachineSink-PHIUse.ll
+++ b/test/CodeGen/X86/MachineSink-PHIUse.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-appel-darwin -disable-cgp-branch-opts -stats |& grep {machine-sink}
+; RUN: llc < %s -mtriple=x86_64-appel-darwin -disable-cgp-branch-opts -stats 2>&1 | grep "machine-sink"
define fastcc void @t() nounwind ssp {
entry:
diff --git a/test/CodeGen/X86/addr-label-difference.ll b/test/CodeGen/X86/addr-label-difference.ll
index 49abd8a92e..15fbec52e2 100644
--- a/test/CodeGen/X86/addr-label-difference.ll
+++ b/test/CodeGen/X86/addr-label-difference.ll
@@ -1,4 +1,4 @@
-; RUN: llc %s -o - | grep {__TEXT,__const}
+; RUN: llc %s -o - | grep "__TEXT,__const"
; PR5929
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-f80:128:128-n8:16:32"
target triple = "i386-apple-darwin10.0"
diff --git a/test/CodeGen/X86/aligned-comm.ll b/test/CodeGen/X86/aligned-comm.ll
index 7715869ed9..eab02cc1f9 100644
--- a/test/CodeGen/X86/aligned-comm.ll
+++ b/test/CodeGen/X86/aligned-comm.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -march=x86
-; RUN: llc < %s -mtriple=i386-apple-darwin10 | grep {array,16512,7}
-; RUN: llc < %s -mtriple=i386-apple-darwin9 | grep {array,16512,7}
+; RUN: llc < %s -mtriple=i386-apple-darwin10 | grep "array,16512,7"
+; RUN: llc < %s -mtriple=i386-apple-darwin9 | grep "array,16512,7"
; Darwin 9+ should get alignment on common symbols.
@array = common global [4128 x i32] zeroinitializer, align 128
diff --git a/test/CodeGen/X86/alloca-align-rounding-32.ll b/test/CodeGen/X86/alloca-align-rounding-32.ll
index a45284e10c..8a8b044d14 100644
--- a/test/CodeGen/X86/alloca-align-rounding-32.ll
+++ b/test/CodeGen/X86/alloca-align-rounding-32.ll
@@ -15,6 +15,5 @@ define void @foo2(i32 %h) {
call void @bar(<2 x i64>* %p)
ret void
; CHECK: foo2
-; CHECK: andl $-32, %esp
; CHECK: andl $-32, %eax
}
diff --git a/test/CodeGen/X86/alloca-align-rounding.ll b/test/CodeGen/X86/alloca-align-rounding.ll
index 3d76fb0aa2..7bc880625c 100644
--- a/test/CodeGen/X86/alloca-align-rounding.ll
+++ b/test/CodeGen/X86/alloca-align-rounding.ll
@@ -15,6 +15,5 @@ define void @foo2(i64 %h) {
call void @bar(<2 x i64>* %p)
ret void
; CHECK: foo2
-; CHECK: andq $-32, %rsp
; CHECK: andq $-32, %rax
}
diff --git a/test/CodeGen/X86/2008-08-25-AsmRegTypeMismatch.ll b/test/CodeGen/X86/asm-reg-type-mismatch.ll
index f0d46a0252..47accdbc07 100644
--- a/test/CodeGen/X86/2008-08-25-AsmRegTypeMismatch.ll
+++ b/test/CodeGen/X86/asm-reg-type-mismatch.ll
@@ -1,5 +1,4 @@
-; RUN: llc < %s -mcpu=core2 | grep xorps | count 2
-; RUN: llc < %s -mcpu=core2 | not grep movap
+; RUN: llc < %s -mcpu=core2 | FileCheck %s
; PR2715
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
@@ -11,8 +10,22 @@ target triple = "x86_64-unknown-linux-gnu"
%struct.nsXPTCVariant = type { %struct.nsXPTCMiniVariant, i8*, %struct.nsXPTType, i8 }
%struct.nsXPTType = type { %struct.XPTTypeDescriptorPrefix }
-define i32 @XPTC_InvokeByIndex(%struct.nsISupports* %that, i32 %methodIndex, i32 %paramCount, %struct.nsXPTCVariant* %params) nounwind {
+define i32 @test1(%struct.nsISupports* %that, i32 %methodIndex, i32 %paramCount, %struct.nsXPTCVariant* %params) nounwind {
entry:
call void asm sideeffect "", "{xmm0},{xmm1},{xmm2},{xmm3},{xmm4},{xmm5},{xmm6},{xmm7},~{dirflag},~{fpsr},~{flags}"( double undef, double undef, double undef, double 1.0, double undef, double 0.0, double undef, double 0.0 ) nounwind
ret i32 0
+ ; CHECK: test1
+ ; CHECK-NOT: movap
+ ; CHECK: xorps
+ ; CHECK: xorps
+ ; CHECK-NOT: movap
+}
+
+define i64 @test2() nounwind {
+entry:
+ %0 = tail call i64 asm sideeffect "movq $1, $0", "={xmm7},*m,~{dirflag},~{fpsr},~{flags}"(i64* null) nounwind
+ ret i64 %0
+ ; CHECK: test2
+ ; CHECK: movq {{.*}}, %xmm7
+ ; CHECK: movd %xmm7, %rax
}
diff --git a/test/CodeGen/X86/avx-shuffle-x86_32.ll b/test/CodeGen/X86/avx-shuffle-x86_32.ll
index 5268ec3a56..e203c4ed02 100755
--- a/test/CodeGen/X86/avx-shuffle-x86_32.ll
+++ b/test/CodeGen/X86/avx-shuffle-x86_32.ll
@@ -4,5 +4,5 @@ define <4 x i64> @test1(<4 x i64> %a) nounwind {
%b = shufflevector <4 x i64> %a, <4 x i64> undef, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
ret <4 x i64>%b
; CHECK: test1:
- ; CHECK: vinsertf128
+ ; CHECK-NOT: vinsertf128
}
diff --git a/test/CodeGen/X86/avx-shuffle.ll b/test/CodeGen/X86/avx-shuffle.ll
index f1debffd11..9b41709a3b 100644
--- a/test/CodeGen/X86/avx-shuffle.ll
+++ b/test/CodeGen/X86/avx-shuffle.ll
@@ -90,8 +90,8 @@ define i32 @test9(<4 x i32> %a) nounwind {
; Extract a value which is the result of an undef mask.
define i32 @test10(<4 x i32> %a) nounwind {
; CHECK: @test10
-; CHECK-NEXT: #
-; CHECK-NEXT: ret
+; CHECK-NOT: {{^[^#]*[a-z]}}
+; CHECK: ret
%b = shufflevector <4 x i32> %a, <4 x i32> undef, <8 x i32> <i32 1, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
%r = extractelement <8 x i32> %b, i32 2
ret i32 %r
@@ -219,3 +219,32 @@ define <16 x i16> @narrow(<16 x i16> %a) nounwind alwaysinline {
%t = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> <i32 2, i32 3, i32 undef, i32 1, i32 6, i32 7, i32 4, i32 5, i32 10, i32 11, i32 8, i32 undef, i32 14, i32 15, i32 undef, i32 undef>
ret <16 x i16> %t
}
+
+;CHECK: test17
+;CHECK-NOT: vinsertf128
+;CHECK: ret
+define <8 x float> @test17(<4 x float> %y) {
+ %x = shufflevector <4 x float> %y, <4 x float> undef, <8 x i32> <i32 undef, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
+ ret <8 x float> %x
+}
+
+; CHECK: test18
+; CHECK: vshufps
+; CHECK: vshufps
+; CHECK: vunpcklps
+; CHECK: ret
+define <8 x float> @test18(<8 x float> %A, <8 x float>%B) nounwind {
+ %S = shufflevector <8 x float> %A, <8 x float> %B, <8 x i32> <i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
+ ret <8 x float>%S
+}
+
+; CHECK: test19
+; CHECK: vshufps
+; CHECK: vshufps
+; CHECK: vunpcklps
+; CHECK: ret
+define <8 x float> @test19(<8 x float> %A, <8 x float>%B) nounwind {
+ %S = shufflevector <8 x float> %A, <8 x float> %B, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
+ ret <8 x float>%S
+}
+
diff --git a/test/CodeGen/X86/avx2-intrinsics-x86.ll b/test/CodeGen/X86/avx2-intrinsics-x86.ll
index 3f27a0291b..459dbb235a 100644
--- a/test/CodeGen/X86/avx2-intrinsics-x86.ll
+++ b/test/CodeGen/X86/avx2-intrinsics-x86.ll
@@ -976,3 +976,163 @@ define void @test_x86_avx_storeu_dq_256(i8* %a0, <32 x i8> %a1) {
ret void
}
declare void @llvm.x86.avx.storeu.dq.256(i8*, <32 x i8>) nounwind
+
+define <2 x double> @test_x86_avx2_gather_d_pd(<2 x double> %a0, i8* %a1,
+ <4 x i32> %idx, <2 x double> %mask) {
+ ; CHECK: vgatherdpd
+ %res = call <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double> %a0,
+ i8* %a1, <4 x i32> %idx, <2 x double> %mask, i8 2) ;
+ ret <2 x double> %res
+}
+declare <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double>, i8*,
+ <4 x i32>, <2 x double>, i8) nounwind readonly
+
+define <4 x double> @test_x86_avx2_gather_d_pd_256(<4 x double> %a0, i8* %a1,
+ <4 x i32> %idx, <4 x double> %mask) {
+ ; CHECK: vgatherdpd
+ %res = call <4 x double> @llvm.x86.avx2.gather.d.pd.256(<4 x double> %a0,
+ i8* %a1, <4 x i32> %idx, <4 x double> %mask, i8 2) ;
+ ret <4 x double> %res
+}
+declare <4 x double> @llvm.x86.avx2.gather.d.pd.256(<4 x double>, i8*,
+ <4 x i32>, <4 x double>, i8) nounwind readonly
+
+define <2 x double> @test_x86_avx2_gather_q_pd(<2 x double> %a0, i8* %a1,
+ <2 x i64> %idx, <2 x double> %mask) {
+ ; CHECK: vgatherqpd
+ %res = call <2 x double> @llvm.x86.avx2.gather.q.pd(<2 x double> %a0,
+ i8* %a1, <2 x i64> %idx, <2 x double> %mask, i8 2) ;
+ ret <2 x double> %res
+}
+declare <2 x double> @llvm.x86.avx2.gather.q.pd(<2 x double>, i8*,
+ <2 x i64>, <2 x double>, i8) nounwind readonly
+
+define <4 x double> @test_x86_avx2_gather_q_pd_256(<4 x double> %a0, i8* %a1,
+ <4 x i64> %idx, <4 x double> %mask) {
+ ; CHECK: vgatherqpd
+ %res = call <4 x double> @llvm.x86.avx2.gather.q.pd.256(<4 x double> %a0,
+ i8* %a1, <4 x i64> %idx, <4 x double> %mask, i8 2) ;
+ ret <4 x double> %res
+}
+declare <4 x double> @llvm.x86.avx2.gather.q.pd.256(<4 x double>, i8*,
+ <4 x i64>, <4 x double>, i8) nounwind readonly
+
+define <4 x float> @test_x86_avx2_gather_d_ps(<4 x float> %a0, i8* %a1,
+ <4 x i32> %idx, <4 x float> %mask) {
+ ; CHECK: vgatherdps
+ %res = call <4 x float> @llvm.x86.avx2.gather.d.ps(<4 x float> %a0,
+ i8* %a1, <4 x i32> %idx, <4 x float> %mask, i8 2) ;
+ ret <4 x float> %res
+}
+declare <4 x float> @llvm.x86.avx2.gather.d.ps(<4 x float>, i8*,
+ <4 x i32>, <4 x float>, i8) nounwind readonly
+
+define <8 x float> @test_x86_avx2_gather_d_ps_256(<8 x float> %a0, i8* %a1,
+ <8 x i32> %idx, <8 x float> %mask) {
+ ; CHECK: vgatherdps
+ %res = call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> %a0,
+ i8* %a1, <8 x i32> %idx, <8 x float> %mask, i8 2) ;
+ ret <8 x float> %res
+}
+declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*,
+ <8 x i32>, <8 x float>, i8) nounwind readonly
+
+define <4 x float> @test_x86_avx2_gather_q_ps(<4 x float> %a0, i8* %a1,
+ <2 x i64> %idx, <4 x float> %mask) {
+ ; CHECK: vgatherqps
+ %res = call <4 x float> @llvm.x86.avx2.gather.q.ps(<4 x float> %a0,
+ i8* %a1, <2 x i64> %idx, <4 x float> %mask, i8 2) ;
+ ret <4 x float> %res
+}
+declare <4 x float> @llvm.x86.avx2.gather.q.ps(<4 x float>, i8*,
+ <2 x i64>, <4 x float>, i8) nounwind readonly
+
+define <4 x float> @test_x86_avx2_gather_q_ps_256(<4 x float> %a0, i8* %a1,
+ <4 x i64> %idx, <4 x float> %mask) {
+ ; CHECK: vgatherqps
+ %res = call <4 x float> @llvm.x86.avx2.gather.q.ps.256(<4 x float> %a0,
+ i8* %a1, <4 x i64> %idx, <4 x float> %mask, i8 2) ;
+ ret <4 x float> %res
+}
+declare <4 x float> @llvm.x86.avx2.gather.q.ps.256(<4 x float>, i8*,
+ <4 x i64>, <4 x float>, i8) nounwind readonly
+
+define <2 x i64> @test_x86_avx2_gather_d_q(<2 x i64> %a0, i8* %a1,
+ <4 x i32> %idx, <2 x i64> %mask) {
+ ; CHECK: vpgatherdq
+ %res = call <2 x i64> @llvm.x86.avx2.gather.d.q(<2 x i64> %a0,
+ i8* %a1, <4 x i32> %idx, <2 x i64> %mask, i8 2) ;
+ ret <2 x i64> %res
+}
+declare <2 x i64> @llvm.x86.avx2.gather.d.q(<2 x i64>, i8*,
+ <4 x i32>, <2 x i64>, i8) nounwind readonly
+
+define <4 x i64> @test_x86_avx2_gather_d_q_256(<4 x i64> %a0, i8* %a1,
+ <4 x i32> %idx, <4 x i64> %mask) {
+ ; CHECK: vpgatherdq
+ %res = call <4 x i64> @llvm.x86.avx2.gather.d.q.256(<4 x i64> %a0,
+ i8* %a1, <4 x i32> %idx, <4 x i64> %mask, i8 2) ;
+ ret <4 x i64> %res
+}
+declare <4 x i64> @llvm.x86.avx2.gather.d.q.256(<4 x i64>, i8*,
+ <4 x i32>, <4 x i64>, i8) nounwind readonly
+
+define <2 x i64> @test_x86_avx2_gather_q_q(<2 x i64> %a0, i8* %a1,
+ <2 x i64> %idx, <2 x i64> %mask) {
+ ; CHECK: vpgatherqq
+ %res = call <2 x i64> @llvm.x86.avx2.gather.q.q(<2 x i64> %a0,
+ i8* %a1, <2 x i64> %idx, <2 x i64> %mask, i8 2) ;
+ ret <2 x i64> %res
+}
+declare <2 x i64> @llvm.x86.avx2.gather.q.q(<2 x i64>, i8*,
+ <2 x i64>, <2 x i64>, i8) nounwind readonly
+
+define <4 x i64> @test_x86_avx2_gather_q_q_256(<4 x i64> %a0, i8* %a1,
+ <4 x i64> %idx, <4 x i64> %mask) {
+ ; CHECK: vpgatherqq
+ %res = call <4 x i64> @llvm.x86.avx2.gather.q.q.256(<4 x i64> %a0,
+ i8* %a1, <4 x i64> %idx, <4 x i64> %mask, i8 2) ;
+ ret <4 x i64> %res
+}
+declare <4 x i64> @llvm.x86.avx2.gather.q.q.256(<4 x i64>, i8*,
+ <4 x i64>, <4 x i64>, i8) nounwind readonly
+
+define <4 x i32> @test_x86_avx2_gather_d_d(<4 x i32> %a0, i8* %a1,
+ <4 x i32> %idx, <4 x i32> %mask) {
+ ; CHECK: vpgatherdd
+ %res = call <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32> %a0,
+ i8* %a1, <4 x i32> %idx, <4 x i32> %mask, i8 2) ;
+ ret <4 x i32> %res
+}
+declare <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32>, i8*,
+ <4 x i32>, <4 x i32>, i8) nounwind readonly
+
+define <8 x i32> @test_x86_avx2_gather_d_d_256(<8 x i32> %a0, i8* %a1,
+ <8 x i32> %idx, <8 x i32> %mask) {
+ ; CHECK: vpgatherdd
+ %res = call <8 x i32> @llvm.x86.avx2.gather.d.d.256(<8 x i32> %a0,
+ i8* %a1, <8 x i32> %idx, <8 x i32> %mask, i8 2) ;
+ ret <8 x i32> %res
+}
+declare <8 x i32> @llvm.x86.avx2.gather.d.d.256(<8 x i32>, i8*,
+ <8 x i32>, <8 x i32>, i8) nounwind readonly
+
+define <4 x i32> @test_x86_avx2_gather_q_d(<4 x i32> %a0, i8* %a1,
+ <2 x i64> %idx, <4 x i32> %mask) {
+ ; CHECK: vpgatherqd
+ %res = call <4 x i32> @llvm.x86.avx2.gather.q.d(<4 x i32> %a0,
+ i8* %a1, <2 x i64> %idx, <4 x i32> %mask, i8 2) ;
+ ret <4 x i32> %res
+}
+declare <4 x i32> @llvm.x86.avx2.gather.q.d(<4 x i32>, i8*,
+ <2 x i64>, <4 x i32>, i8) nounwind readonly
+
+define <4 x i32> @test_x86_avx2_gather_q_d_256(<4 x i32> %a0, i8* %a1,
+ <4 x i64> %idx, <4 x i32> %mask) {
+ ; CHECK: vpgatherqd
+ %res = call <4 x i32> @llvm.x86.avx2.gather.q.d.256(<4 x i32> %a0,
+ i8* %a1, <4 x i64> %idx, <4 x i32> %mask, i8 2) ;
+ ret <4 x i32> %res
+}
+declare <4 x i32> @llvm.x86.avx2.gather.q.d.256(<4 x i32>, i8*,
+ <4 x i64>, <4 x i32>, i8) nounwind readonly
diff --git a/test/CodeGen/X86/avx2-vbroadcast.ll b/test/CodeGen/X86/avx2-vbroadcast.ll
index 46b41fa953..b804233663 100644
--- a/test/CodeGen/X86/avx2-vbroadcast.ll
+++ b/test/CodeGen/X86/avx2-vbroadcast.ll
@@ -259,3 +259,99 @@ define <4 x double> @_inreg3(double %scalar) nounwind uwtable readnone ssp {
ret <4 x double> %wide
}
+;CHECK: _inreg8xfloat
+;CHECK: vbroadcastss
+;CHECK: ret
+define <8 x float> @_inreg8xfloat(<8 x float> %a) {
+ %b = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> zeroinitializer
+ ret <8 x float> %b
+}
+
+;CHECK: _inreg4xfloat
+;CHECK: vbroadcastss
+;CHECK: ret
+define <4 x float> @_inreg4xfloat(<4 x float> %a) {
+ %b = shufflevector <4 x float> %a, <4 x float> undef, <4 x i32> zeroinitializer
+ ret <4 x float> %b
+}
+
+;CHECK: _inreg16xi16
+;CHECK: vpbroadcastw
+;CHECK: ret
+define <16 x i16> @_inreg16xi16(<16 x i16> %a) {
+ %b = shufflevector <16 x i16> %a, <16 x i16> undef, <16 x i32> zeroinitializer
+ ret <16 x i16> %b
+}
+
+;CHECK: _inreg8xi16
+;CHECK: vpbroadcastw
+;CHECK: ret
+define <8 x i16> @_inreg8xi16(<8 x i16> %a) {
+ %b = shufflevector <8 x i16> %a, <8 x i16> undef, <8 x i32> zeroinitializer
+ ret <8 x i16> %b
+}
+
+
+;CHECK: _inreg4xi64
+;CHECK: vpbroadcastq
+;CHECK: ret
+define <4 x i64> @_inreg4xi64(<4 x i64> %a) {
+ %b = shufflevector <4 x i64> %a, <4 x i64> undef, <4 x i32> zeroinitializer
+ ret <4 x i64> %b
+}
+
+;CHECK: _inreg2xi64
+;CHECK: vpbroadcastq
+;CHECK: ret
+define <2 x i64> @_inreg2xi64(<2 x i64> %a) {
+ %b = shufflevector <2 x i64> %a, <2 x i64> undef, <2 x i32> zeroinitializer
+ ret <2 x i64> %b
+}
+
+;CHECK: _inreg4xdouble
+;CHECK: vbroadcastsd
+;CHECK: ret
+define <4 x double> @_inreg4xdouble(<4 x double> %a) {
+ %b = shufflevector <4 x double> %a, <4 x double> undef, <4 x i32> zeroinitializer
+ ret <4 x double> %b
+}
+
+;CHECK: _inreg2xdouble
+;CHECK: vpbroadcastq
+;CHECK: ret
+define <2 x double> @_inreg2xdouble(<2 x double> %a) {
+ %b = shufflevector <2 x double> %a, <2 x double> undef, <2 x i32> zeroinitializer
+ ret <2 x double> %b
+}
+
+;CHECK: _inreg8xi32
+;CHECK: vpbroadcastd
+;CHECK: ret
+define <8 x i32> @_inreg8xi32(<8 x i32> %a) {
+ %b = shufflevector <8 x i32> %a, <8 x i32> undef, <8 x i32> zeroinitializer
+ ret <8 x i32> %b
+}
+
+;CHECK: _inreg4xi32
+;CHECK: vpbroadcastd
+;CHECK: ret
+define <4 x i32> @_inreg4xi32(<4 x i32> %a) {
+ %b = shufflevector <4 x i32> %a, <4 x i32> undef, <4 x i32> zeroinitializer
+ ret <4 x i32> %b
+}
+
+;CHECK: _inreg32xi8
+;CHECK: vpbroadcastb
+;CHECK: ret
+define <32 x i8> @_inreg32xi8(<32 x i8> %a) {
+ %b = shufflevector <32 x i8> %a, <32 x i8> undef, <32 x i32> zeroinitializer
+ ret <32 x i8> %b
+}
+
+;CHECK: _inreg16xi8
+;CHECK: vpbroadcastb
+;CHECK: ret
+define <16 x i8> @_inreg16xi8(<16 x i8> %a) {
+ %b = shufflevector <16 x i8> %a, <16 x i8> undef, <16 x i32> zeroinitializer
+ ret <16 x i8> %b
+}
diff --git a/test/CodeGen/X86/break-anti-dependencies.ll b/test/CodeGen/X86/break-anti-dependencies.ll
index cf774591d8..c94261467c 100644
--- a/test/CodeGen/X86/break-anti-dependencies.ll
+++ b/test/CodeGen/X86/break-anti-dependencies.ll
@@ -2,11 +2,11 @@
; Use a subtarget that has post-RA scheduling enabled because the anti-dependency
; breaker requires liveness information to be kept.
; RUN: llc < %s -march=x86-64 -mcpu=atom -post-RA-scheduler -pre-RA-sched=list-burr -break-anti-dependencies=none > %t
-; RUN: grep {%xmm0} %t | count 14
-; RUN: not grep {%xmm1} %t
+; RUN: grep "%xmm0" %t | count 14
+; RUN: not grep "%xmm1" %t
; RUN: llc < %s -march=x86-64 -mcpu=atom -post-RA-scheduler -break-anti-dependencies=critical > %t
-; RUN: grep {%xmm0} %t | count 7
-; RUN: grep {%xmm1} %t | count 7
+; RUN: grep "%xmm0" %t | count 7
+; RUN: grep "%xmm1" %t | count 7
define void @goo(double* %r, double* %p, double* %q) nounwind {
entry:
diff --git a/test/CodeGen/X86/call-imm.ll b/test/CodeGen/X86/call-imm.ll
index 3857fb1579..38cda4d140 100644
--- a/test/CodeGen/X86/call-imm.ll
+++ b/test/CodeGen/X86/call-imm.ll
@@ -1,11 +1,11 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | grep {call.*12345678}
-; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | not grep {call.*12345678}
-; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | grep {call.*12345678}
+; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | grep "call.*12345678"
+; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | not grep "call.*12345678"
+; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | grep "call.*12345678"
; Call to immediate is not safe on x86-64 unless we *know* that the
; call will be within 32-bits pcrel from the dest immediate.
-; RUN: llc < %s -march=x86-64 | grep {call.*\\*%rax}
+; RUN: llc < %s -march=x86-64 | grep "call.*\*%rax"
; PR3666
; PR3773
diff --git a/test/CodeGen/X86/coalesce-esp.ll b/test/CodeGen/X86/coalesce-esp.ll
index a5848763c9..4004379938 100644
--- a/test/CodeGen/X86/coalesce-esp.ll
+++ b/test/CodeGen/X86/coalesce-esp.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | grep {movl %esp, %ebp}
+; RUN: llc < %s | grep "movl %esp, %ebp"
; PR4572
; Don't coalesce with %esp if it would end up putting %esp in
diff --git a/test/CodeGen/X86/constructor.ll b/test/CodeGen/X86/constructor.ll
new file mode 100644
index 0000000000..b57889643e
--- /dev/null
+++ b/test/CodeGen/X86/constructor.ll
@@ -0,0 +1,27 @@
+; RUN: llc -mtriple x86_64-pc-linux < %s | FileCheck --check-prefix=CTOR %s
+; RUN: llc -mtriple x86_64-pc-linux -use-init-array < %s | FileCheck --check-prefix=INIT-ARRAY %s
+@llvm.global_ctors = appending global [2 x { i32, void ()* }] [{ i32, void ()* } { i32 65535, void ()* @f }, { i32, void ()* } { i32 15, void ()* @g }]
+
+define void @f() {
+entry:
+ ret void
+}
+
+define void @g() {
+entry:
+ ret void
+}
+
+; CTOR: .section .ctors.65520,"aw",@progbits
+; CTOR-NEXT: .align 8
+; CTOR-NEXT: .quad g
+; CTOR-NEXT: .section .ctors,"aw",@progbits
+; CTOR-NEXT: .align 8
+; CTOR-NEXT: .quad f
+
+; INIT-ARRAY: .section .init_array.15,"aw",@init_array
+; INIT-ARRAY-NEXT: .align 8
+; INIT-ARRAY-NEXT: .quad g
+; INIT-ARRAY-NEXT: .section .init_array,"aw",@init_array
+; INIT-ARRAY-NEXT: .align 8
+; INIT-ARRAY-NEXT: .quad f
diff --git a/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll b/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll
index b82348b32e..064ee364d1 100644
--- a/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll
+++ b/test/CodeGen/X86/convert-2-addr-3-addr-inc64.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mtriple=x86_64-linux -o /dev/null -stats |& FileCheck %s -check-prefix=STATS
-; RUN: llc < %s -mtriple=x86_64-win32 -o /dev/null -stats |& FileCheck %s -check-prefix=STATS
+; RUN: llc < %s -mtriple=x86_64-linux -o /dev/null -stats 2>&1 | FileCheck %s -check-prefix=STATS
+; RUN: llc < %s -mtriple=x86_64-win32 -o /dev/null -stats 2>&1 | FileCheck %s -check-prefix=STATS
; STATS: 9 asm-printer
; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s
diff --git a/test/CodeGen/X86/crash.ll b/test/CodeGen/X86/crash.ll
index cf6e27d159..c71c6ec81d 100644
--- a/test/CodeGen/X86/crash.ll
+++ b/test/CodeGen/X86/crash.ll
@@ -1,5 +1,5 @@
-; RUN: llc -march=x86 %s -o -
-; RUN: llc -march=x86-64 %s -o -
+; RUN: llc -march=x86 < %s -verify-machineinstrs
+; RUN: llc -march=x86-64 < %s -verify-machineinstrs
; PR6497
@@ -391,3 +391,38 @@ if.end:
%t11 = tail call i64 asm sideeffect "foo", "=*m,=A,{bx},{cx},1,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* %t6, i32 0, i32 0, i64 0) nounwind
ret void
}
+
+; Avoid emitting wrong kill flags from InstrEmitter.
+; InstrEmitter::EmitSubregNode() may steal virtual registers from already
+; emitted blocks when isCoalescableExtInstr points out the opportunity.
+; Make sure kill flags are cleared on the newly global virtual register.
+define i64 @ov_read(i8* %vf, i8* nocapture %buffer, i32 %length, i32 %bigendianp, i32 %word, i32 %sgned, i32* %bitstream) nounwind uwtable ssp {
+entry:
+ br i1 undef, label %return, label %while.body.preheader
+
+while.body.preheader: ; preds = %entry
+ br i1 undef, label %if.then3, label %if.end7
+
+if.then3: ; preds = %while.body.preheader
+ %0 = load i32* undef, align 4
+ br i1 undef, label %land.lhs.true.i255, label %if.end7
+
+land.lhs.true.i255: ; preds = %if.then3
+ br i1 undef, label %if.then.i256, label %if.end7
+
+if.then.i256: ; preds = %land.lhs.true.i255
+ %sub.i = sub i32 0, %0
+ %conv = sext i32 %sub.i to i64
+ br i1 undef, label %if.end7, label %while.end
+
+if.end7: ; preds = %if.then.i256, %land.lhs.true.i255, %if.then3, %while.body.preheader
+ unreachable
+
+while.end: ; preds = %if.then.i256
+ %cmp18 = icmp sgt i32 %sub.i, 0
+ %.conv = select i1 %cmp18, i64 -131, i64 %conv
+ ret i64 %.conv
+
+return: ; preds = %entry
+ ret i64 -131
+}
diff --git a/test/CodeGen/X86/dagcombine-cse.ll b/test/CodeGen/X86/dagcombine-cse.ll
index c3c7990d19..af69531246 100644
--- a/test/CodeGen/X86/dagcombine-cse.ll
+++ b/test/CodeGen/X86/dagcombine-cse.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -stats |& grep asm-printer | grep 14
+; RUN: llc < %s -march=x86 -mattr=+sse2 -mtriple=i386-apple-darwin -stats 2>&1 | grep asm-printer | grep 14
define i32 @t(i8* %ref_frame_ptr, i32 %ref_frame_stride, i32 %idxX, i32 %idxY) nounwind {
entry:
diff --git a/test/CodeGen/X86/dynamic-allocas-VLAs.ll b/test/CodeGen/X86/dynamic-allocas-VLAs.ll
deleted file mode 100644
index b787ee87c5..0000000000
--- a/test/CodeGen/X86/dynamic-allocas-VLAs.ll
+++ /dev/null
@@ -1,158 +0,0 @@
-; RUN: llc < %s -march=x86-64 -mattr=+avx -mtriple=i686-apple-darwin10 | FileCheck %s
-; rdar://11496434
-
-; no VLAs or dynamic alignment
-define i32 @t1() nounwind uwtable ssp {
-entry:
- %a = alloca i32, align 4
- call void @t1_helper(i32* %a) nounwind
- %0 = load i32* %a, align 4
- %add = add nsw i32 %0, 13
- ret i32 %add
-
-; CHECK: _t1
-; CHECK-NOT: andq $-{{[0-9]+}}, %rsp
-; CHECK: leaq [[OFFSET:[0-9]*]](%rsp), %rdi
-; CHECK: callq _t1_helper
-; CHECK: movl [[OFFSET]](%rsp), %eax
-; CHECK: addl $13, %eax
-}
-
-declare void @t1_helper(i32*)
-
-; dynamic realignment
-define i32 @t2() nounwind uwtable ssp {
-entry:
- %a = alloca i32, align 4
- %v = alloca <8 x float>, align 32
- call void @t2_helper(i32* %a, <8 x float>* %v) nounwind
- %0 = load i32* %a, align 4
- %add = add nsw i32 %0, 13
- ret i32 %add
-
-; CHECK: _t2
-; CHECK: pushq %rbp
-; CHECK: movq %rsp, %rbp
-; CHECK: andq $-32, %rsp
-; CHECK: subq ${{[0-9]+}}, %rsp
-;
-; CHECK: leaq {{[0-9]*}}(%rsp), %rdi
-; CHECK: leaq {{[0-9]*}}(%rsp), %rsi
-; CHECK: callq _t2_helper
-;
-; CHECK: movq %rbp, %rsp
-; CHECK: popq %rbp
-}
-
-declare void @t2_helper(i32*, <8 x float>*)
-
-; VLAs
-define i32 @t3(i64 %sz) nounwind uwtable ssp {
-entry:
- %a = alloca i32, align 4
- %vla = alloca i32, i64 %sz, align 16
- call void @t3_helper(i32* %a, i32* %vla) nounwind
- %0 = load i32* %a, align 4
- %add = add nsw i32 %0, 13
- ret i32 %add
-
-; CHECK: _t3
-; CHECK: pushq %rbp
-; CHECK: movq %rsp, %rbp
-; CHECK: pushq %rbx
-; CHECK-NOT: andq $-{{[0-9]+}}, %rsp
-; CHECK: subq ${{[0-9]+}}, %rsp
-;
-; CHECK: leaq -{{[0-9]+}}(%rbp), %rsp
-; CHECK: popq %rbx
-; CHECK: popq %rbp
-}
-
-declare void @t3_helper(i32*, i32*)
-
-; VLAs + Dynamic realignment
-define i32 @t4(i64 %sz) nounwind uwtable ssp {
-entry:
- %a = alloca i32, align 4
- %v = alloca <8 x float>, align 32
- %vla = alloca i32, i64 %sz, align 16
- call void @t4_helper(i32* %a, i32* %vla, <8 x float>* %v) nounwind
- %0 = load i32* %a, align 4
- %add = add nsw i32 %0, 13
- ret i32 %add
-
-; CHECK: _t4
-; CHECK: pushq %rbp
-; CHECK: movq %rsp, %rbp
-; CHECK: andq $-32, %rsp
-; CHECK: pushq %r14
-; CHECK: pushq %rbx
-; CHECK: subq $[[STACKADJ:[0-9]+]], %rsp
-; CHECK: movq %rsp, %rbx
-;
-; CHECK: leaq {{[0-9]*}}(%rbx), %rdi
-; CHECK: leaq {{[0-9]*}}(%rbx), %rdx
-; CHECK: callq _t4_helper
-;
-; CHECK: addq $[[STACKADJ]], %rsp
-; CHECK: popq %rbx
-; CHECK: popq %r14
-; CHECK: movq %rbp, %rsp
-; CHECK: popq %rbp
-}
-
-declare void @t4_helper(i32*, i32*, <8 x float>*)
-
-; Dynamic realignment + Spill
-define i32 @t5(float* nocapture %f) nounwind uwtable ssp {
-entry:
- %a = alloca i32, align 4
- %0 = bitcast float* %f to <8 x float>*
- %1 = load <8 x float>* %0, align 32
- call void @t5_helper1(i32* %a) nounwind
- call void @t5_helper2(<8 x float> %1) nounwind
- %2 = load i32* %a, align 4
- %add = add nsw i32 %2, 13
- ret i32 %add
-
-; CHECK: _t5
-; CHECK: pushq %rbp
-; CHECK: movq %rsp, %rbp
-; CHECK: andq $-32, %rsp
-; CHECK: subq ${{[0-9]+}}, %rsp
-;
-; CHECK: vmovaps (%rdi), [[AVXREG:%ymm[0-9]+]]
-; CHECK: vmovaps [[AVXREG]], (%rsp)
-; CHECK: leaq {{[0-9]+}}(%rsp), %rdi
-; CHECK: callq _t5_helper1
-; CHECK: vmovaps (%rsp), %ymm0
-; CHECK: callq _t5_helper2
-; CHECK: movl {{[0-9]+}}(%rsp), %eax
-;
-; CHECK: movq %rbp, %rsp
-; CHECK: popq %rbp
-}
-
-declare void @t5_helper1(i32*)
-
-declare void @t5_helper2(<8 x float>)
-
-; VLAs + Dynamic realignment + Spill
-; FIXME: RA has already reserved RBX, so we can't do dynamic realignment.
-define i32 @t6(i64 %sz, float* nocapture %f) nounwind uwtable ssp {
-entry:
-; CHECK: _t6
- %a = alloca i32, align 4
- %0 = bitcast float* %f to <8 x float>*
- %1 = load <8 x float>* %0, align 32
- %vla = alloca i32, i64 %sz, align 16
- call void @t6_helper1(i32* %a, i32* %vla) nounwind
- call void @t6_helper2(<8 x float> %1) nounwind
- %2 = load i32* %a, align 4
- %add = add nsw i32 %2, 13
- ret i32 %add
-}
-
-declare void @t6_helper1(i32*, i32*)
-
-declare void @t6_helper2(<8 x float>)
diff --git a/test/CodeGen/X86/epilogue.ll b/test/CodeGen/X86/epilogue.ll
index 0f16a64ccd..7ab10a5886 100644
--- a/test/CodeGen/X86/epilogue.ll
+++ b/test/CodeGen/X86/epilogue.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mcpu=generic -march=x86 | not grep lea
-; RUN: llc < %s -mcpu=generic -march=x86 | grep {movl %ebp}
+; RUN: llc < %s -mcpu=generic -march=x86 | grep "movl %ebp"
declare void @bar(<2 x i64>* %n)
diff --git a/test/CodeGen/X86/extractps.ll b/test/CodeGen/X86/extractps.ll
index 14778f097e..9e1a3754d0 100644
--- a/test/CodeGen/X86/extractps.ll
+++ b/test/CodeGen/X86/extractps.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=x86 -mcpu=penryn > %t
; RUN: not grep movd %t
-; RUN: grep {movss %xmm} %t | count 1
-; RUN: grep {extractps \\\$1, %xmm0, } %t | count 1
+; RUN: grep "movss %xmm" %t | count 1
+; RUN: grep "extractps \$1, %xmm0, " %t | count 1
; PR2647
external global float, align 16 ; <float*>:0 [#uses=2]
diff --git a/test/CodeGen/X86/fast-cc-merge-stack-adj.ll b/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
index e4982f0549..14cb136f89 100644
--- a/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
+++ b/test/CodeGen/X86/fast-cc-merge-stack-adj.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mcpu=generic -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {add ESP, 8}
+; RUN: grep "add ESP, 8"
target triple = "i686-pc-linux-gnu"
diff --git a/test/CodeGen/X86/fast-isel-constpool.ll b/test/CodeGen/X86/fast-isel-constpool.ll
index 323c8533ce..b3adb802a8 100644
--- a/test/CodeGen/X86/fast-isel-constpool.ll
+++ b/test/CodeGen/X86/fast-isel-constpool.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -fast-isel | grep {LCPI0_0(%rip)}
+; RUN: llc < %s -fast-isel | grep "LCPI0_0(%rip)"
; Make sure fast isel uses rip-relative addressing when required.
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-apple-darwin9.0"
diff --git a/test/CodeGen/X86/fast-isel-gv.ll b/test/CodeGen/X86/fast-isel-gv.ll
index 34f8b38252..cb2464e746 100644
--- a/test/CodeGen/X86/fast-isel-gv.ll
+++ b/test/CodeGen/X86/fast-isel-gv.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -fast-isel | grep {_kill@GOTPCREL(%rip)}
+; RUN: llc < %s -fast-isel | grep "_kill@GOTPCREL(%rip)"
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-apple-darwin10.0"
@f = global i8 (...)* @kill ; <i8 (...)**> [#uses=1]
diff --git a/test/CodeGen/X86/fastcc-byval.ll b/test/CodeGen/X86/fastcc-byval.ll
index 52b3e57b96..f1204d677a 100644
--- a/test/CodeGen/X86/fastcc-byval.ll
+++ b/test/CodeGen/X86/fastcc-byval.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -tailcallopt=false | grep {movl\[\[:space:\]\]*8(%esp), %eax} | count 2
+; RUN: llc < %s -tailcallopt=false | grep "movl[[:space:]]*8(%esp), %eax" | count 2
; PR3122
; rdar://6400815
diff --git a/test/CodeGen/X86/force-align-stack-alloca.ll b/test/CodeGen/X86/force-align-stack-alloca.ll
new file mode 100644
index 0000000000..48f963f58e
--- /dev/null
+++ b/test/CodeGen/X86/force-align-stack-alloca.ll
@@ -0,0 +1,63 @@
+; This test is attempting to detect when we request forced re-alignment of the
+; stack to an alignment greater than would be available due to the ABI. We
+; arbitrarily force alignment up to 32-bytes for i386 hoping that this will
+; exceed any ABI provisions.
+;
+; RUN: llc < %s -force-align-stack -stack-alignment=32 | FileCheck %s
+
+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-f80:32:32-n8:16:32-S128"
+target triple = "i386-unknown-linux-gnu"
+
+define i32 @f(i8* %p) nounwind {
+entry:
+ %0 = load i8* %p
+ %conv = sext i8 %0 to i32
+ ret i32 %conv
+}
+
+define i64 @g(i32 %i) nounwind {
+; CHECK: g:
+; CHECK: pushl
+; CHECK-NEXT: movl %esp, %ebp
+; CHECK-NEXT: pushl
+; CHECK-NEXT: subl $20, %esp
+; CHECK-NOT: {{[^ ,]*}}, %esp
+;
+; The next adjustment of the stack is due to the alloca.
+; CHECK: movl %{{...}}, %esp
+; CHECK-NOT: {{[^ ,]*}}, %esp
+;
+; Next we set up the memset call, and then undo it.
+; CHECK: subl $32, %esp
+; CHECK-NOT: {{[^ ,]*}}, %esp
+; CHECK: calll memset
+; CHECK-NEXT: addl $32, %esp
+; CHECK-NOT: {{[^ ,]*}}, %esp
+;
+; Next we set up the call to 'f'.
+; CHECK: subl $32, %esp
+; CHECK-NOT: {{[^ ,]*}}, %esp
+; CHECK: calll f
+; CHECK-NEXT: addl $32, %esp
+; CHECK-NOT: {{[^ ,]*}}, %esp
+;
+; Finally we nede to restore %esp from %ebp, the alloca prevents us from
+; restoring it directly.
+; CHECK-NOT: popl
+; CHECK: leal -4(%ebp), %esp
+; CHECK-NEXT: popl
+; CHECK-NEXT: popl
+; CHECK-NEXT: ret
+
+entry:
+ br label %if.then
+
+if.then:
+ %0 = alloca i8, i32 %i
+ call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 %i, i32 1, i1 false)
+ %call = call i32 @f(i8* %0)
+ %conv = sext i32 %call to i64
+ ret i64 %conv
+}
+
+declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) nounwind
diff --git a/test/CodeGen/X86/fp-immediate-shorten.ll b/test/CodeGen/X86/fp-immediate-shorten.ll
index cafc61a41f..62d81003a6 100644
--- a/test/CodeGen/X86/fp-immediate-shorten.ll
+++ b/test/CodeGen/X86/fp-immediate-shorten.ll
@@ -1,7 +1,7 @@
;; Test that this FP immediate is stored in the constant pool as a float.
; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3 | \
-; RUN: grep {.long.1123418112}
+; RUN: grep ".long.1123418112"
define double @D() {
ret double 1.230000e+02
diff --git a/test/CodeGen/X86/fp_load_fold.ll b/test/CodeGen/X86/fp_load_fold.ll
index 0145069b8c..a2cea5e57f 100644
--- a/test/CodeGen/X86/fp_load_fold.ll
+++ b/test/CodeGen/X86/fp_load_fold.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul}
+; RUN: grep -i ST | not grep "fadd\|fsub\|fdiv\|fmul"
; Test that the load of the memory location is folded into the operation.
diff --git a/test/CodeGen/X86/full-lsr.ll b/test/CodeGen/X86/full-lsr.ll
index ff9b1b0b6a..655ab29127 100644
--- a/test/CodeGen/X86/full-lsr.ll
+++ b/test/CodeGen/X86/full-lsr.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=x86 >%t
-; RUN: grep {addl \\\$4,} %t | count 3
-; RUN: not grep {,%} %t
+; RUN: grep "addl \$4," %t | count 3
+; RUN: not grep ",%" %t
define void @foo(float* nocapture %A, float* nocapture %B, float* nocapture %C, i32 %N) nounwind {
entry:
diff --git a/test/CodeGen/X86/h-register-addressing-32.ll b/test/CodeGen/X86/h-register-addressing-32.ll
index 76ffd66524..968a9e88c0 100644
--- a/test/CodeGen/X86/h-register-addressing-32.ll
+++ b/test/CodeGen/X86/h-register-addressing-32.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep {movzbl %\[abcd\]h,} | count 7
+; RUN: llc < %s -march=x86 | grep "movzbl %[abcd]h," | count 7
; Use h-register extract and zero-extend.
diff --git a/test/CodeGen/X86/h-register-addressing-64.ll b/test/CodeGen/X86/h-register-addressing-64.ll
index 98817f3fb5..a19fca5558 100644
--- a/test/CodeGen/X86/h-register-addressing-64.ll
+++ b/test/CodeGen/X86/h-register-addressing-64.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86-64 | grep {movzbl %\[abcd\]h,} | count 7
+; RUN: llc < %s -march=x86-64 | grep "movzbl %[abcd]h," | count 7
; Use h-register extract and zero-extend.
diff --git a/test/CodeGen/X86/h-registers-1.ll b/test/CodeGen/X86/h-registers-1.ll
index 402cdfe413..903c4538ab 100644
--- a/test/CodeGen/X86/h-registers-1.ll
+++ b/test/CodeGen/X86/h-registers-1.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -mtriple=x86_64-linux > %t
-; RUN: grep {movzbl %\[abcd\]h,} %t | count 8
-; RUN: grep {%\[abcd\]h} %t | not grep {%r\[\[:digit:\]\]*d}
+; RUN: grep "movzbl %[abcd]h," %t | count 8
+; RUN: grep "%[abcd]h" %t | not grep "%r[[:digit:]]*d"
; LLVM creates virtual registers for values live across blocks
; based on the type of the value. Make sure that the extracts
diff --git a/test/CodeGen/X86/hoist-invariant-load.ll b/test/CodeGen/X86/hoist-invariant-load.ll
index 4289fa7cc2..74ecd045b3 100644
--- a/test/CodeGen/X86/hoist-invariant-load.ll
+++ b/test/CodeGen/X86/hoist-invariant-load.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -stats -O2 |& grep "1 machine-licm"
+; RUN: llc < %s -stats -O2 2>&1 | grep "1 machine-licm"
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.7.2"
diff --git a/test/CodeGen/X86/illegal-vector-args-return.ll b/test/CodeGen/X86/illegal-vector-args-return.ll
index b8a129d963..62a21f4c5a 100644
--- a/test/CodeGen/X86/illegal-vector-args-return.ll
+++ b/test/CodeGen/X86/illegal-vector-args-return.ll
@@ -1,7 +1,7 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {mulpd %xmm3, %xmm1}
-; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {mulpd %xmm2, %xmm0}
-; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {addps %xmm3, %xmm1}
-; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {addps %xmm2, %xmm0}
+; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "mulpd %xmm3, %xmm1"
+; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "mulpd %xmm2, %xmm0"
+; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "addps %xmm3, %xmm1"
+; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "addps %xmm2, %xmm0"
define <4 x double> @foo(<4 x double> %x, <4 x double> %z) {
%y = fmul <4 x double> %x, %z
diff --git a/test/CodeGen/X86/inline-asm-modifier-n.ll b/test/CodeGen/X86/inline-asm-modifier-n.ll
index 5e76b6c058..b069c46318 100644
--- a/test/CodeGen/X86/inline-asm-modifier-n.ll
+++ b/test/CodeGen/X86/inline-asm-modifier-n.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep { 37}
+; RUN: llc < %s -march=x86 | grep " 37"
; rdar://7008959
define void @bork() nounwind {
diff --git a/test/CodeGen/X86/isel-sink2.ll b/test/CodeGen/X86/isel-sink2.ll
index 5ed0e00fd8..b162666362 100644
--- a/test/CodeGen/X86/isel-sink2.ll
+++ b/test/CodeGen/X86/isel-sink2.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 > %t
-; RUN: grep {movb.7(%...)} %t
+; RUN: grep "movb.7(%...)" %t
; RUN: not grep leal %t
define i8 @test(i32 *%P) nounwind {
diff --git a/test/CodeGen/X86/ispositive.ll b/test/CodeGen/X86/ispositive.ll
index 8adf723aab..b1d1a20c8e 100644
--- a/test/CodeGen/X86/ispositive.ll
+++ b/test/CodeGen/X86/ispositive.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep {shrl.*31}
+; RUN: llc < %s -march=x86 | grep "shrl.*31"
define i32 @test1(i32 %X) {
entry:
diff --git a/test/CodeGen/X86/label-redefinition.ll b/test/CodeGen/X86/label-redefinition.ll
index 9ad33e0297..9e88a18e87 100644
--- a/test/CodeGen/X86/label-redefinition.ll
+++ b/test/CodeGen/X86/label-redefinition.ll
@@ -1,5 +1,5 @@
; PR7054
-; RUN: not llc %s -o - |& grep {'_foo' label emitted multiple times to assembly}
+; RUN: not llc %s -o - 2>&1 | grep "'_foo' label emitted multiple times to assembly"
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-f80:128:128-n8:16:32"
target triple = "i386-apple-darwin10.0.0"
diff --git a/test/CodeGen/X86/large-global.ll b/test/CodeGen/X86/large-global.ll
new file mode 100644
index 0000000000..7cb974b21e
--- /dev/null
+++ b/test/CodeGen/X86/large-global.ll
@@ -0,0 +1,11 @@
+; RUN: llc < %s -mtriple=x86_64-apple-macosx | FileCheck %s
+; rdar://11729134
+
+; EmitZerofill was incorrectly expecting a 32-bit "size" so 26214400000
+; was printed as 444596224
+
+%struct.X = type { [25000 x i8] }
+
+@gArray = global [1048576 x %struct.X] zeroinitializer, align 16
+
+; CHECK: .zerofill __DATA,__common,_gArray,26214400000,4
diff --git a/test/CodeGen/X86/lea-2.ll b/test/CodeGen/X86/lea-2.ll
index 69303507d6..43f69b0c6e 100644
--- a/test/CodeGen/X86/lea-2.ll
+++ b/test/CodeGen/X86/lea-2.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {lea EAX, DWORD PTR \\\[... + 4\\*... - 5\\\]}
+; RUN: grep "lea EAX, DWORD PTR \[... + 4\*... - 5\]"
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
; RUN: not grep add
diff --git a/test/CodeGen/X86/multiple-loop-post-inc.ll b/test/CodeGen/X86/multiple-loop-post-inc.ll
index 7491190b01..9f7d036cf1 100644
--- a/test/CodeGen/X86/multiple-loop-post-inc.ll
+++ b/test/CodeGen/X86/multiple-loop-post-inc.ll
@@ -1,9 +1,9 @@
; RUN: llc -asm-verbose=false -disable-branch-fold -disable-code-place -disable-tail-duplicate -march=x86-64 -mcpu=nehalem < %s | FileCheck %s
; rdar://7236213
-
-; Xfailed now that scheduler 2-address hack is disabled a lea is generated.
-; The code isn't any worse though.
-; XFAIL: *
+;
+; The scheduler's 2-address hack has been disabled, so there is
+; currently no good guarantee that this test will pass until the
+; machine scheduler develops an equivalent heuristic.
; CodeGen shouldn't require any lea instructions inside the marked loop.
; It should properly set up post-increment uses and do coalescing for
diff --git a/test/CodeGen/X86/overlap-shift.ll b/test/CodeGen/X86/overlap-shift.ll
index d185af16b9..e987495f2c 100644
--- a/test/CodeGen/X86/overlap-shift.ll
+++ b/test/CodeGen/X86/overlap-shift.ll
@@ -7,7 +7,7 @@
; Check that the shift gets turned into an LEA.
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: not grep {mov E.X, E.X}
+; RUN: not grep "mov E.X, E.X"
@G = external global i32 ; <i32*> [#uses=1]
diff --git a/test/CodeGen/X86/peep-vector-extract-insert.ll b/test/CodeGen/X86/peep-vector-extract-insert.ll
index d48a331826..f958b6b2c0 100644
--- a/test/CodeGen/X86/peep-vector-extract-insert.ll
+++ b/test/CodeGen/X86/peep-vector-extract-insert.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86-64 | grep {xorps %xmm0, %xmm0} | count 2
+; RUN: llc < %s -march=x86-64 | grep "xorps %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/phi-immediate-factoring.ll b/test/CodeGen/X86/phi-immediate-factoring.ll
index ef02af2d78..476bb10998 100644
--- a/test/CodeGen/X86/phi-immediate-factoring.ll
+++ b/test/CodeGen/X86/phi-immediate-factoring.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -stats |& grep {Number of blocks eliminated} | grep 6
+; RUN: llc < %s -march=x86 -stats 2>&1 | grep "Number of blocks eliminated" | grep 6
; PR1296
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/pr2656.ll b/test/CodeGen/X86/pr2656.ll
index afd71143c4..f0e31f7f5f 100644
--- a/test/CodeGen/X86/pr2656.ll
+++ b/test/CodeGen/X86/pr2656.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 | grep {xorps.\*sp} | count 1
+; RUN: llc < %s -march=x86 -mattr=+sse2 | grep "xorps.*sp" | count 1
; PR2656
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-f80:128:128"
diff --git a/test/CodeGen/X86/pr3522.ll b/test/CodeGen/X86/pr3522.ll
index 112253038b..d8f37781fc 100644
--- a/test/CodeGen/X86/pr3522.ll
+++ b/test/CodeGen/X86/pr3522.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -stats |& not grep {instructions sunk}
+; RUN: llc < %s -march=x86 -stats 2>&1 | not grep "instructions sunk"
; PR3522
target triple = "i386-pc-linux-gnu"
diff --git a/test/CodeGen/X86/regpressure.ll b/test/CodeGen/X86/regpressure.ll
index e0b5f7a870..52d7b56f18 100644
--- a/test/CodeGen/X86/regpressure.ll
+++ b/test/CodeGen/X86/regpressure.ll
@@ -1,8 +1,8 @@
;; Both functions in this testcase should codegen to the same function, and
;; neither of them should require spilling anything to the stack.
-; RUN: llc < %s -march=x86 -stats |& \
-; RUN: not grep {Number of register spills}
+; RUN: llc < %s -march=x86 -stats 2>&1 | \
+; RUN: not grep "Number of register spills"
;; This can be compiled to use three registers if the loads are not
;; folded into the multiplies, 2 registers otherwise.
diff --git a/test/CodeGen/X86/remat-scalar-zero.ll b/test/CodeGen/X86/remat-scalar-zero.ll
index 75f438d26c..f6095a7556 100644
--- a/test/CodeGen/X86/remat-scalar-zero.ll
+++ b/test/CodeGen/X86/remat-scalar-zero.ll
@@ -3,7 +3,7 @@
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu > %t
; RUN: not grep xor %t
; RUN: not grep movap %t
-; RUN: grep {\\.quad.*0} %t
+; RUN: grep "\.quad.*0" %t
; Remat should be able to fold the zero constant into the div instructions
; as a constant-pool load.
diff --git a/test/CodeGen/X86/rotate.ll b/test/CodeGen/X86/rotate.ll
index 1e20273194..117300110b 100644
--- a/test/CodeGen/X86/rotate.ll
+++ b/test/CodeGen/X86/rotate.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {ro\[rl\]} | count 12
+; RUN: grep "ro[rl]" | count 12
define i32 @rotl32(i32 %A, i8 %Amt) {
%shift.upgrd.1 = zext i8 %Amt to i32 ; <i32> [#uses=1]
diff --git a/test/CodeGen/X86/shift-coalesce.ll b/test/CodeGen/X86/shift-coalesce.ll
index d38f9a88fc..4f27e97fb3 100644
--- a/test/CodeGen/X86/shift-coalesce.ll
+++ b/test/CodeGen/X86/shift-coalesce.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {shld.*CL}
+; RUN: grep "shld.*CL"
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: not grep {mov CL, BL}
+; RUN: not grep "mov CL, BL"
; PR687
diff --git a/test/CodeGen/X86/shift-double.ll b/test/CodeGen/X86/shift-double.ll
index 5adee7c769..8d2b2907c5 100644
--- a/test/CodeGen/X86/shift-double.ll
+++ b/test/CodeGen/X86/shift-double.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
-; RUN: grep {sh\[lr\]d} | count 5
+; RUN: grep "sh[lr]d" | count 5
define i64 @test1(i64 %X, i8 %C) {
%shift.upgrd.1 = zext i8 %C to i64 ; <i64> [#uses=1]
diff --git a/test/CodeGen/X86/shl_elim.ll b/test/CodeGen/X86/shl_elim.ll
index 0827221875..83e1eb5c39 100644
--- a/test/CodeGen/X86/shl_elim.ll
+++ b/test/CodeGen/X86/shl_elim.ll
@@ -1,6 +1,6 @@
-; RUN: llc < %s -march=x86 | grep {movl 8(.esp), %eax}
-; RUN: llc < %s -march=x86 | grep {shrl .eax}
-; RUN: llc < %s -march=x86 | grep {movswl .ax, .eax}
+; RUN: llc < %s -march=x86 | grep "movl 8(.esp), %eax"
+; RUN: llc < %s -march=x86 | grep "shrl .eax"
+; RUN: llc < %s -march=x86 | grep "movswl .ax, .eax"
define i32 @test1(i64 %a) nounwind {
%tmp29 = lshr i64 %a, 24 ; <i64> [#uses=1]
diff --git a/test/CodeGen/X86/sse_reload_fold.ll b/test/CodeGen/X86/sse_reload_fold.ll
index a57fa588f0..fd8db3be10 100644
--- a/test/CodeGen/X86/sse_reload_fold.ll
+++ b/test/CodeGen/X86/sse_reload_fold.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-linux -mattr=+64bit,+sse3 -print-failed-fuse-candidates -regalloc=basic |& FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-linux -mattr=+64bit,+sse3 -print-failed-fuse-candidates -regalloc=basic 2>&1 | FileCheck %s
; CHECK: fail
; CHECK-NOT: fail
diff --git a/test/CodeGen/X86/stack-protector-linux.ll b/test/CodeGen/X86/stack-protector-linux.ll
index fe2a9c5d57..c07511443b 100644
--- a/test/CodeGen/X86/stack-protector-linux.ll
+++ b/test/CodeGen/X86/stack-protector-linux.ll
@@ -1,8 +1,8 @@
; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | grep %gs:
; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %fs:
; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %gs:
-; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_guard}
-; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_fail}
+; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_guard"
+; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_fail"
@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1]
diff --git a/test/CodeGen/X86/subreg-to-reg-1.ll b/test/CodeGen/X86/subreg-to-reg-1.ll
index a297728aee..4f31ab5a92 100644
--- a/test/CodeGen/X86/subreg-to-reg-1.ll
+++ b/test/CodeGen/X86/subreg-to-reg-1.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86-64 | grep {leal .*), %e.\*} | count 1
+; RUN: llc < %s -march=x86-64 | grep "leal .*), %e.*" | count 1
; Don't eliminate or coalesce away the explicit zero-extension!
; This is currently using an leal because of a 3-addressification detail,
diff --git a/test/CodeGen/X86/subreg-to-reg-4.ll b/test/CodeGen/X86/subreg-to-reg-4.ll
index 0ea5541c89..0693789fe5 100644
--- a/test/CodeGen/X86/subreg-to-reg-4.ll
+++ b/test/CodeGen/X86/subreg-to-reg-4.ll
@@ -5,7 +5,7 @@
; RUN: not grep negq %t
; RUN: not grep addq %t
; RUN: not grep subq %t
-; RUN: not grep {movl %} %t
+; RUN: not grep "movl %" %t
; Utilize implicit zero-extension on x86-64 to eliminate explicit
; zero-extensions. Shrink 64-bit adds to 32-bit when the high
diff --git a/test/CodeGen/X86/tailcallbyval.ll b/test/CodeGen/X86/tailcallbyval.ll
index 03d6f9411e..118eee6ba6 100644
--- a/test/CodeGen/X86/tailcallbyval.ll
+++ b/test/CodeGen/X86/tailcallbyval.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86 -tailcallopt | grep TAILCALL
-; RUN: llc < %s -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1
+; RUN: llc < %s -march=x86 -tailcallopt | grep "movl[[:space:]]*4(%esp), %eax" | count 1
%struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
i32, i32, i32, i32, i32, i32, i32, i32,
i32, i32, i32, i32, i32, i32, i32, i32 }
diff --git a/test/CodeGen/X86/tls-models.ll b/test/CodeGen/X86/tls-models.ll
new file mode 100644
index 0000000000..7c527e210a
--- /dev/null
+++ b/test/CodeGen/X86/tls-models.ll
@@ -0,0 +1,166 @@
+; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=X64 %s
+; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X64_PIC %s
+; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu | FileCheck -check-prefix=X32 %s
+; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -relocation-model=pic | FileCheck -check-prefix=X32_PIC %s
+
+; Darwin always uses the same model.
+; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck -check-prefix=DARWIN %s
+
+@external_gd = external thread_local global i32
+@internal_gd = internal thread_local global i32 42
+
+@external_ld = external thread_local(localdynamic) global i32
+@internal_ld = internal thread_local(localdynamic) global i32 42
+
+@external_ie = external thread_local(initialexec) global i32
+@internal_ie = internal thread_local(initialexec) global i32 42
+
+@external_le = external thread_local(localexec) global i32
+@internal_le = internal thread_local(localexec) global i32 42
+
+; ----- no model specified -----
+
+define i32* @f1() {
+entry:
+ ret i32* @external_gd
+
+ ; Non-PIC code can use initial-exec, PIC code has to use general dynamic.
+ ; X64: f1:
+ ; X64: external_gd@GOTTPOFF
+ ; X32: f1:
+ ; X32: external_gd@INDNTPOFF
+ ; X64_PIC: f1:
+ ; X64_PIC: external_gd@TLSGD
+ ; X32_PIC: f1:
+ ; X32_PIC: external_gd@TLSGD
+ ; DARWIN: f1:
+ ; DARWIN: _external_gd@TLVP
+}
+
+define i32* @f2() {
+entry:
+ ret i32* @internal_gd
+
+ ; Non-PIC code can use local exec, PIC code can use local dynamic.
+ ; X64: f2:
+ ; X64: internal_gd@TPOFF
+ ; X32: f2:
+ ; X32: internal_gd@NTPOFF
+ ; X64_PIC: f2:
+ ; X64_PIC: internal_gd@TLSLD
+ ; X32_PIC: f2:
+ ; X32_PIC: internal_gd@TLSLDM
+ ; DARWIN: f2:
+ ; DARWIN: _internal_gd@TLVP
+}
+
+
+; ----- localdynamic specified -----
+
+define i32* @f3() {
+entry:
+ ret i32* @external_ld
+
+ ; Non-PIC code can use initial exec, PIC code use local dynamic as specified.
+ ; X64: f3:
+ ; X64: external_ld@GOTTPOFF
+ ; X32: f3:
+ ; X32: external_ld@INDNTPOFF
+ ; X64_PIC: f3:
+ ; X64_PIC: external_ld@TLSLD
+ ; X32_PIC: f3:
+ ; X32_PIC: external_ld@TLSLDM
+ ; DARWIN: f3:
+ ; DARWIN: _external_ld@TLVP
+}
+
+define i32* @f4() {
+entry:
+ ret i32* @internal_ld
+
+ ; Non-PIC code can use local exec, PIC code can use local dynamic.
+ ; X64: f4:
+ ; X64: internal_ld@TPOFF
+ ; X32: f4:
+ ; X32: internal_ld@NTPOFF
+ ; X64_PIC: f4:
+ ; X64_PIC: internal_ld@TLSLD
+ ; X32_PIC: f4:
+ ; X32_PIC: internal_ld@TLSLDM
+ ; DARWIN: f4:
+ ; DARWIN: _internal_ld@TLVP
+}
+
+
+; ----- initialexec specified -----
+
+define i32* @f5() {
+entry:
+ ret i32* @external_ie
+
+ ; Non-PIC and PIC code will use initial exec as specified.
+ ; X64: f5:
+ ; X64: external_ie@GOTTPOFF
+ ; X32: f5:
+ ; X32: external_ie@INDNTPOFF
+ ; X64_PIC: f5:
+ ; X64_PIC: external_ie@GOTTPOFF
+ ; X32_PIC: f5:
+ ; X32_PIC: external_ie@GOTNTPOFF
+ ; DARWIN: f5:
+ ; DARWIN: _external_ie@TLVP
+}
+
+define i32* @f6() {
+entry:
+ ret i32* @internal_ie
+
+ ; Non-PIC code can use local exec, PIC code use initial exec as specified.
+ ; X64: f6:
+ ; X64: internal_ie@TPOFF
+ ; X32: f6:
+ ; X32: internal_ie@NTPOFF
+ ; X64_PIC: f6:
+ ; X64_PIC: internal_ie@GOTTPOFF
+ ; X32_PIC: f6:
+ ; X32_PIC: internal_ie@GOTNTPOFF
+ ; DARWIN: f6:
+ ; DARWIN: _internal_ie@TLVP
+}
+
+
+; ----- localexec specified -----
+
+define i32* @f7() {
+entry:
+ ret i32* @external_le
+
+ ; Non-PIC and PIC code will use local exec as specified.
+ ; X64: f7:
+ ; X64: external_le@TPOFF
+ ; X32: f7:
+ ; X32: external_le@NTPOFF
+ ; X64_PIC: f7:
+ ; X64_PIC: external_le@TPOFF
+ ; X32_PIC: f7:
+ ; X32_PIC: external_le@NTPOFF
+ ; DARWIN: f7:
+ ; DARWIN: _external_le@TLVP
+}
+
+define i32* @f8() {
+entry:
+ ret i32* @internal_le
+
+ ; Non-PIC and PIC code will use local exec as specified.
+ ; X64: f8:
+ ; X64: internal_le@TPOFF
+ ; X32: f8:
+ ; X32: internal_le@NTPOFF
+ ; X64_PIC: f8:
+ ; X64_PIC: internal_le@TPOFF
+ ; X32_PIC: f8:
+ ; X32_PIC: internal_le@NTPOFF
+ ; DARWIN: f8:
+ ; DARWIN: _internal_le@TLVP
+}
diff --git a/test/CodeGen/X86/twoaddr-coalesce-2.ll b/test/CodeGen/X86/twoaddr-coalesce-2.ll
index 51ddc491aa..af6d47af7a 100644
--- a/test/CodeGen/X86/twoaddr-coalesce-2.ll
+++ b/test/CodeGen/X86/twoaddr-coalesce-2.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=penryn -stats |& \
-; RUN: grep {twoaddrinstr} | grep {Number of instructions aggressively commuted}
+; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=penryn -stats 2>&1 | \
+; RUN: grep "twoaddrinstr" | grep "Number of instructions aggressively commuted"
; rdar://6480363
target triple = "i386-apple-darwin9.6"
diff --git a/test/CodeGen/X86/twoaddr-pass-sink.ll b/test/CodeGen/X86/twoaddr-pass-sink.ll
index 077fee0773..513c304e3b 100644
--- a/test/CodeGen/X86/twoaddr-pass-sink.ll
+++ b/test/CodeGen/X86/twoaddr-pass-sink.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& grep {Number of 3-address instructions sunk}
+; RUN: llc < %s -march=x86 -mattr=+sse2 -stats 2>&1 | grep "Number of 3-address instructions sunk"
define void @t2(<2 x i64>* %vDct, <2 x i64>* %vYp, i8* %skiplist, <2 x i64> %a1) nounwind {
entry:
diff --git a/test/CodeGen/X86/uint_to_fp.ll b/test/CodeGen/X86/uint_to_fp.ll
index 41ee1947ed..0536eb0522 100644
--- a/test/CodeGen/X86/uint_to_fp.ll
+++ b/test/CodeGen/X86/uint_to_fp.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mcpu=yonah | not grep {sub.*esp}
+; RUN: llc < %s -march=x86 -mcpu=yonah | not grep "sub.*esp"
; RUN: llc < %s -march=x86 -mcpu=yonah | grep cvtsi2ss
; rdar://6034396
diff --git a/test/CodeGen/X86/umul-with-carry.ll b/test/CodeGen/X86/umul-with-carry.ll
index 7416051693..56fdadbf93 100644
--- a/test/CodeGen/X86/umul-with-carry.ll
+++ b/test/CodeGen/X86/umul-with-carry.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep {jc} | count 1
+; RUN: llc < %s -march=x86 | grep "jc" | count 1
; XFAIL: *
; FIXME: umul-with-overflow not supported yet.
diff --git a/test/CodeGen/X86/unwindraise.ll b/test/CodeGen/X86/unwindraise.ll
new file mode 100644
index 0000000000..a438723d9b
--- /dev/null
+++ b/test/CodeGen/X86/unwindraise.ll
@@ -0,0 +1,252 @@
+; RUN: llc < %s -verify-machineinstrs
+; PR13188
+;
+; The _Unwind_RaiseException function can return normally and via eh.return.
+; This causes confusion about the function live-out registers, since the two
+; different ways of returning have different return values.
+;
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-freebsd9.0"
+
+%struct._Unwind_Context = type { [18 x i8*], i8*, i8*, i8*, %struct.dwarf_eh_bases, i64, i64, i64, [18 x i8] }
+%struct.dwarf_eh_bases = type { i8*, i8*, i8* }
+%struct._Unwind_FrameState = type { %struct.frame_state_reg_info, i64, i64, i8*, i32, i8*, i32 (i32, i32, i64, %struct._Unwind_Exception*, %struct._Unwind_Context*)*, i64, i64, i64, i8, i8, i8, i8, i8* }
+%struct.frame_state_reg_info = type { [18 x %struct.anon], %struct.frame_state_reg_info* }
+%struct.anon = type { %union.anon, i32 }
+%union.anon = type { i64 }
+%struct._Unwind_Exception = type { i64, void (i32, %struct._Unwind_Exception*)*, i64, i64 }
+
+@dwarf_reg_size_table = external hidden unnamed_addr global [18 x i8], align 16
+
+declare void @abort() noreturn
+
+declare fastcc i32 @uw_frame_state_for(%struct._Unwind_Context*, %struct._Unwind_FrameState*) uwtable
+
+define hidden i32 @_Unwind_RaiseException(%struct._Unwind_Exception* %exc) uwtable {
+entry:
+ %fs.i = alloca %struct._Unwind_FrameState, align 8
+ %this_context = alloca %struct._Unwind_Context, align 8
+ %cur_context = alloca %struct._Unwind_Context, align 8
+ %fs = alloca %struct._Unwind_FrameState, align 8
+ call void @llvm.eh.unwind.init()
+ %0 = call i8* @llvm.eh.dwarf.cfa(i32 0)
+ %1 = call i8* @llvm.returnaddress(i32 0)
+ call fastcc void @uw_init_context_1(%struct._Unwind_Context* %this_context, i8* %0, i8* %1)
+ %2 = bitcast %struct._Unwind_Context* %cur_context to i8*
+ %3 = bitcast %struct._Unwind_Context* %this_context to i8*
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %3, i64 240, i32 8, i1 false)
+ %personality = getelementptr inbounds %struct._Unwind_FrameState* %fs, i64 0, i32 6
+ %retaddr_column.i = getelementptr inbounds %struct._Unwind_FrameState* %fs, i64 0, i32 9
+ %flags.i.i.i.i = getelementptr inbounds %struct._Unwind_Context* %cur_context, i64 0, i32 5
+ %ra.i = getelementptr inbounds %struct._Unwind_Context* %cur_context, i64 0, i32 2
+ %exception_class = getelementptr inbounds %struct._Unwind_Exception* %exc, i64 0, i32 0
+ br label %while.body
+
+while.body: ; preds = %uw_update_context.exit, %entry
+ %call = call fastcc i32 @uw_frame_state_for(%struct._Unwind_Context* %cur_context, %struct._Unwind_FrameState* %fs)
+ switch i32 %call, label %do.end21 [
+ i32 5, label %do.end21.loopexit46
+ i32 0, label %if.end3
+ ]
+
+if.end3: ; preds = %while.body
+ %4 = load i32 (i32, i32, i64, %struct._Unwind_Exception*, %struct._Unwind_Context*)** %personality, align 8, !tbaa !0
+ %tobool = icmp eq i32 (i32, i32, i64, %struct._Unwind_Exception*, %struct._Unwind_Context*)* %4, null
+ br i1 %tobool, label %if.end13, label %if.then4
+
+if.then4: ; preds = %if.end3
+ %5 = load i64* %exception_class, align 8, !tbaa !3
+ %call6 = call i32 %4(i32 1, i32 1, i64 %5, %struct._Unwind_Exception* %exc, %struct._Unwind_Context* %cur_context)
+ switch i32 %call6, label %do.end21.loopexit46 [
+ i32 6, label %while.end
+ i32 8, label %if.end13
+ ]
+
+if.end13: ; preds = %if.then4, %if.end3
+ call fastcc void @uw_update_context_1(%struct._Unwind_Context* %cur_context, %struct._Unwind_FrameState* %fs)
+ %6 = load i64* %retaddr_column.i, align 8, !tbaa !3
+ %conv.i = trunc i64 %6 to i32
+ %cmp.i.i.i = icmp slt i32 %conv.i, 18
+ br i1 %cmp.i.i.i, label %cond.end.i.i.i, label %cond.true.i.i.i
+
+cond.true.i.i.i: ; preds = %if.end13
+ call void @abort() noreturn
+ unreachable
+
+cond.end.i.i.i: ; preds = %if.end13
+ %sext.i = shl i64 %6, 32
+ %idxprom.i.i.i = ashr exact i64 %sext.i, 32
+ %arrayidx.i.i.i = getelementptr inbounds [18 x i8]* @dwarf_reg_size_table, i64 0, i64 %idxprom.i.i.i
+ %7 = load i8* %arrayidx.i.i.i, align 1, !tbaa !1
+ %arrayidx2.i.i.i = getelementptr inbounds %struct._Unwind_Context* %cur_context, i64 0, i32 0, i64 %idxprom.i.i.i
+ %8 = load i8** %arrayidx2.i.i.i, align 8, !tbaa !0
+ %9 = load i64* %flags.i.i.i.i, align 8, !tbaa !3
+ %and.i.i.i.i = and i64 %9, 4611686018427387904
+ %tobool.i.i.i = icmp eq i64 %and.i.i.i.i, 0
+ br i1 %tobool.i.i.i, label %if.end.i.i.i, label %land.lhs.true.i.i.i
+
+land.lhs.true.i.i.i: ; preds = %cond.end.i.i.i
+ %arrayidx4.i.i.i = getelementptr inbounds %struct._Unwind_Context* %cur_context, i64 0, i32 8, i64 %idxprom.i.i.i
+ %10 = load i8* %arrayidx4.i.i.i, align 1, !tbaa !1
+ %tobool6.i.i.i = icmp eq i8 %10, 0
+ br i1 %tobool6.i.i.i, label %if.end.i.i.i, label %if.then.i.i.i
+
+if.then.i.i.i: ; preds = %land.lhs.true.i.i.i
+ %11 = ptrtoint i8* %8 to i64
+ br label %uw_update_context.exit
+
+if.end.i.i.i: ; preds = %land.lhs.true.i.i.i, %cond.end.i.i.i
+ %cmp8.i.i.i = icmp eq i8 %7, 8
+ br i1 %cmp8.i.i.i, label %if.then10.i.i.i, label %cond.true14.i.i.i
+
+if.then10.i.i.i: ; preds = %if.end.i.i.i
+ %12 = bitcast i8* %8 to i64*
+ %13 = load i64* %12, align 8, !tbaa !3
+ br label %uw_update_context.exit
+
+cond.true14.i.i.i: ; preds = %if.end.i.i.i
+ call void @abort() noreturn
+ unreachable
+
+uw_update_context.exit: ; preds = %if.then10.i.i.i, %if.then.i.i.i
+ %retval.0.i.i.i = phi i64 [ %11, %if.then.i.i.i ], [ %13, %if.then10.i.i.i ]
+ %14 = inttoptr i64 %retval.0.i.i.i to i8*
+ store i8* %14, i8** %ra.i, align 8, !tbaa !0
+ br label %while.body
+
+while.end: ; preds = %if.then4
+ %private_1 = getelementptr inbounds %struct._Unwind_Exception* %exc, i64 0, i32 2
+ store i64 0, i64* %private_1, align 8, !tbaa !3
+ %15 = load i8** %ra.i, align 8, !tbaa !0
+ %16 = ptrtoint i8* %15 to i64
+ %private_2 = getelementptr inbounds %struct._Unwind_Exception* %exc, i64 0, i32 3
+ store i64 %16, i64* %private_2, align 8, !tbaa !3
+ call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %3, i64 240, i32 8, i1 false)
+ %17 = bitcast %struct._Unwind_FrameState* %fs.i to i8*
+ call void @llvm.lifetime.start(i64 -1, i8* %17)
+ %personality.i = getelementptr inbounds %struct._Unwind_FrameState* %fs.i, i64 0, i32 6
+ %retaddr_column.i22 = getelementptr inbounds %struct._Unwind_FrameState* %fs.i, i64 0, i32 9
+ br label %while.body.i
+
+while.body.i: ; preds = %uw_update_context.exit44, %while.end
+ %call.i = call fastcc i32 @uw_frame_state_for(%struct._Unwind_Context* %cur_context, %struct._Unwind_FrameState* %fs.i)
+ %18 = load i8** %ra.i, align 8, !tbaa !0
+ %19 = ptrtoint i8* %18 to i64
+ %20 = load i64* %private_2, align 8, !tbaa !3
+ %cmp.i = icmp eq i64 %19, %20
+ %cmp2.i = icmp eq i32 %call.i, 0
+ br i1 %cmp2.i, label %if.end.i, label %do.end21
+
+if.end.i: ; preds = %while.body.i
+ %21 = load i32 (i32, i32, i64, %struct._Unwind_Exception*, %struct._Unwind_Context*)** %personality.i, align 8, !tbaa !0
+ %tobool.i = icmp eq i32 (i32, i32, i64, %struct._Unwind_Exception*, %struct._Unwind_Context*)* %21, null
+ br i1 %tobool.i, label %if.end12.i, label %if.then3.i
+
+if.then3.i: ; preds = %if.end.i
+ %or.i = select i1 %cmp.i, i32 6, i32 2
+ %22 = load i64* %exception_class, align 8, !tbaa !3
+ %call5.i = call i32 %21(i32 1, i32 %or.i, i64 %22, %struct._Unwind_Exception* %exc, %struct._Unwind_Context* %cur_context)
+ switch i32 %call5.i, label %do.end21 [
+ i32 7, label %do.body19
+ i32 8, label %if.end12.i
+ ]
+
+if.end12.i: ; preds = %if.then3.i, %if.end.i
+ br i1 %cmp.i, label %cond.true.i, label %cond.end.i
+
+cond.true.i: ; preds = %if.end12.i
+ call void @abort() noreturn
+ unreachable
+
+cond.end.i: ; preds = %if.end12.i
+ call fastcc void @uw_update_context_1(%struct._Unwind_Context* %cur_context, %struct._Unwind_FrameState* %fs.i)
+ %23 = load i64* %retaddr_column.i22, align 8, !tbaa !3
+ %conv.i23 = trunc i64 %23 to i32
+ %cmp.i.i.i24 = icmp slt i32 %conv.i23, 18
+ br i1 %cmp.i.i.i24, label %cond.end.i.i.i33, label %cond.true.i.i.i25
+
+cond.true.i.i.i25: ; preds = %cond.end.i
+ call void @abort() noreturn
+ unreachable
+
+cond.end.i.i.i33: ; preds = %cond.end.i
+ %sext.i26 = shl i64 %23, 32
+ %idxprom.i.i.i27 = ashr exact i64 %sext.i26, 32
+ %arrayidx.i.i.i28 = getelementptr inbounds [18 x i8]* @dwarf_reg_size_table, i64 0, i64 %idxprom.i.i.i27
+ %24 = load i8* %arrayidx.i.i.i28, align 1, !tbaa !1
+ %arrayidx2.i.i.i29 = getelementptr inbounds %struct._Unwind_Context* %cur_context, i64 0, i32 0, i64 %idxprom.i.i.i27
+ %25 = load i8** %arrayidx2.i.i.i29, align 8, !tbaa !0
+ %26 = load i64* %flags.i.i.i.i, align 8, !tbaa !3
+ %and.i.i.i.i31 = and i64 %26, 4611686018427387904
+ %tobool.i.i.i32 = icmp eq i64 %and.i.i.i.i31, 0
+ br i1 %tobool.i.i.i32, label %if.end.i.i.i39, label %land.lhs.true.i.i.i36
+
+land.lhs.true.i.i.i36: ; preds = %cond.end.i.i.i33
+ %arrayidx4.i.i.i34 = getelementptr inbounds %struct._Unwind_Context* %cur_context, i64 0, i32 8, i64 %idxprom.i.i.i27
+ %27 = load i8* %arrayidx4.i.i.i34, align 1, !tbaa !1
+ %tobool6.i.i.i35 = icmp eq i8 %27, 0
+ br i1 %tobool6.i.i.i35, label %if.end.i.i.i39, label %if.then.i.i.i37
+
+if.then.i.i.i37: ; preds = %land.lhs.true.i.i.i36
+ %28 = ptrtoint i8* %25 to i64
+ br label %uw_update_context.exit44
+
+if.end.i.i.i39: ; preds = %land.lhs.true.i.i.i36, %cond.end.i.i.i33
+ %cmp8.i.i.i38 = icmp eq i8 %24, 8
+ br i1 %cmp8.i.i.i38, label %if.then10.i.i.i40, label %cond.true14.i.i.i41
+
+if.then10.i.i.i40: ; preds = %if.end.i.i.i39
+ %29 = bitcast i8* %25 to i64*
+ %30 = load i64* %29, align 8, !tbaa !3
+ br label %uw_update_context.exit44
+
+cond.true14.i.i.i41: ; preds = %if.end.i.i.i39
+ call void @abort() noreturn
+ unreachable
+
+uw_update_context.exit44: ; preds = %if.then10.i.i.i40, %if.then.i.i.i37
+ %retval.0.i.i.i42 = phi i64 [ %28, %if.then.i.i.i37 ], [ %30, %if.then10.i.i.i40 ]
+ %31 = inttoptr i64 %retval.0.i.i.i42 to i8*
+ store i8* %31, i8** %ra.i, align 8, !tbaa !0
+ br label %while.body.i
+
+do.body19: ; preds = %if.then3.i
+ call void @llvm.lifetime.end(i64 -1, i8* %17)
+ %call20 = call fastcc i64 @uw_install_context_1(%struct._Unwind_Context* %this_context, %struct._Unwind_Context* %cur_context)
+ %32 = load i8** %ra.i, align 8, !tbaa !0
+ call void @llvm.eh.return.i64(i64 %call20, i8* %32)
+ unreachable
+
+do.end21.loopexit46: ; preds = %if.then4, %while.body
+ %retval.0.ph = phi i32 [ 3, %if.then4 ], [ 5, %while.body ]
+ br label %do.end21
+
+do.end21: ; preds = %do.end21.loopexit46, %if.then3.i, %while.body.i, %while.body
+ %retval.0 = phi i32 [ %retval.0.ph, %do.end21.loopexit46 ], [ 3, %while.body ], [ 2, %while.body.i ], [ 2, %if.then3.i ]
+ ret i32 %retval.0
+}
+
+declare void @llvm.eh.unwind.init() nounwind
+
+declare fastcc void @uw_init_context_1(%struct._Unwind_Context*, i8*, i8*) uwtable
+
+declare i8* @llvm.eh.dwarf.cfa(i32) nounwind
+
+declare i8* @llvm.returnaddress(i32) nounwind readnone
+
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
+
+declare fastcc i64 @uw_install_context_1(%struct._Unwind_Context*, %struct._Unwind_Context*) uwtable
+
+declare void @llvm.eh.return.i64(i64, i8*) nounwind
+
+declare fastcc void @uw_update_context_1(%struct._Unwind_Context*, %struct._Unwind_FrameState* nocapture) uwtable
+
+declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind
+
+declare void @llvm.lifetime.end(i64, i8* nocapture) nounwind
+
+!0 = metadata !{metadata !"any pointer", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
+!3 = metadata !{metadata !"long", metadata !1}
diff --git a/test/CodeGen/X86/vec_call.ll b/test/CodeGen/X86/vec_call.ll
index f2fc7e7d9d..e0862ca8d1 100644
--- a/test/CodeGen/X86/vec_call.ll
+++ b/test/CodeGen/X86/vec_call.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -mcpu=generic -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \
-; RUN: grep {subl.*60}
+; RUN: grep "subl.*60"
; RUN: llc < %s -mcpu=generic -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \
-; RUN: grep {movaps.*32}
+; RUN: grep "movaps.*32"
define void @test() {
diff --git a/test/CodeGen/X86/vec_ins_extract-1.ll b/test/CodeGen/X86/vec_ins_extract-1.ll
index 29511934af..565be7a6cc 100644
--- a/test/CodeGen/X86/vec_ins_extract-1.ll
+++ b/test/CodeGen/X86/vec_ins_extract-1.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -mcpu=yonah | grep {(%esp,%eax,4)} | count 4
+; RUN: llc < %s -march=x86 -mcpu=yonah | grep "(%esp,%eax,4)" | count 4
; Inserts and extracts with variable indices must be lowered
; to memory accesses.
diff --git a/test/CodeGen/X86/vec_set-9.ll b/test/CodeGen/X86/vec_set-9.ll
index 3656e5f6ca..b8ec0cf080 100644
--- a/test/CodeGen/X86/vec_set-9.ll
+++ b/test/CodeGen/X86/vec_set-9.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=x86-64 | grep movd | count 1
-; RUN: llc < %s -march=x86-64 | grep {movlhps.*%xmm0, %xmm0}
+; RUN: llc < %s -march=x86-64 | grep "movlhps.*%xmm0, %xmm0"
define <2 x i64> @test3(i64 %A) nounwind {
entry:
diff --git a/test/CodeGen/X86/x86-64-arg.ll b/test/CodeGen/X86/x86-64-arg.ll
index ec8dd8edb6..9a959e839a 100644
--- a/test/CodeGen/X86/x86-64-arg.ll
+++ b/test/CodeGen/X86/x86-64-arg.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s | grep {movl %edi, %eax}
+; RUN: llc < %s | grep "movl %edi, %eax"
; The input value is already sign extended, don't re-extend it.
; This testcase corresponds to:
; int test(short X) { return (int)X; }
diff --git a/test/CodeGen/X86/x86-64-pic-1.ll b/test/CodeGen/X86/x86-64-pic-1.ll
index 46f6d335d0..46cd4f81bc 100644
--- a/test/CodeGen/X86/x86-64-pic-1.ll
+++ b/test/CodeGen/X86/x86-64-pic-1.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {callq f@PLT} %t1
+; RUN: grep "callq f@PLT" %t1
define void @g() {
entry:
diff --git a/test/CodeGen/X86/x86-64-pic-10.ll b/test/CodeGen/X86/x86-64-pic-10.ll
index b6f82e23b7..3ec172b2b6 100644
--- a/test/CodeGen/X86/x86-64-pic-10.ll
+++ b/test/CodeGen/X86/x86-64-pic-10.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {callq g@PLT} %t1
+; RUN: grep "callq g@PLT" %t1
@g = alias weak i32 ()* @f
diff --git a/test/CodeGen/X86/x86-64-pic-11.ll b/test/CodeGen/X86/x86-64-pic-11.ll
index 4db331cee4..fd64beb696 100644
--- a/test/CodeGen/X86/x86-64-pic-11.ll
+++ b/test/CodeGen/X86/x86-64-pic-11.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {callq __fixunsxfti@PLT} %t1
+; RUN: grep "callq __fixunsxfti@PLT" %t1
define i128 @f(x86_fp80 %a) nounwind {
entry:
diff --git a/test/CodeGen/X86/x86-64-pic-2.ll b/test/CodeGen/X86/x86-64-pic-2.ll
index 1ce2de7209..f3f7b1dffd 100644
--- a/test/CodeGen/X86/x86-64-pic-2.ll
+++ b/test/CodeGen/X86/x86-64-pic-2.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {callq f} %t1
-; RUN: not grep {callq f@PLT} %t1
+; RUN: grep "callq f" %t1
+; RUN: not grep "callq f@PLT" %t1
define void @g() {
entry:
diff --git a/test/CodeGen/X86/x86-64-pic-3.ll b/test/CodeGen/X86/x86-64-pic-3.ll
index aa3c888ed6..ba933788a3 100644
--- a/test/CodeGen/X86/x86-64-pic-3.ll
+++ b/test/CodeGen/X86/x86-64-pic-3.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {callq f} %t1
-; RUN: not grep {callq f@PLT} %t1
+; RUN: grep "callq f" %t1
+; RUN: not grep "callq f@PLT" %t1
define void @g() {
entry:
diff --git a/test/CodeGen/X86/x86-64-pic-4.ll b/test/CodeGen/X86/x86-64-pic-4.ll
index 90fc1194a3..33b08c4b4b 100644
--- a/test/CodeGen/X86/x86-64-pic-4.ll
+++ b/test/CodeGen/X86/x86-64-pic-4.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {movq a@GOTPCREL(%rip),} %t1
+; RUN: grep "movq a@GOTPCREL(%rip)," %t1
@a = global i32 0
diff --git a/test/CodeGen/X86/x86-64-pic-5.ll b/test/CodeGen/X86/x86-64-pic-5.ll
index 6369bde694..234bc0d2f4 100644
--- a/test/CodeGen/X86/x86-64-pic-5.ll
+++ b/test/CodeGen/X86/x86-64-pic-5.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {movl a(%rip),} %t1
+; RUN: grep "movl a(%rip)," %t1
; RUN: not grep GOTPCREL %t1
@a = hidden global i32 0
diff --git a/test/CodeGen/X86/x86-64-pic-6.ll b/test/CodeGen/X86/x86-64-pic-6.ll
index 6e19ad35bc..ae5b583592 100644
--- a/test/CodeGen/X86/x86-64-pic-6.ll
+++ b/test/CodeGen/X86/x86-64-pic-6.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {movl a(%rip),} %t1
+; RUN: grep "movl a(%rip)," %t1
; RUN: not grep GOTPCREL %t1
@a = internal global i32 0
diff --git a/test/CodeGen/X86/x86-64-pic-7.ll b/test/CodeGen/X86/x86-64-pic-7.ll
index 4d98ee6140..de240a38d6 100644
--- a/test/CodeGen/X86/x86-64-pic-7.ll
+++ b/test/CodeGen/X86/x86-64-pic-7.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {movq f@GOTPCREL(%rip),} %t1
+; RUN: grep "movq f@GOTPCREL(%rip)," %t1
define void ()* @g() nounwind {
entry:
diff --git a/test/CodeGen/X86/x86-64-pic-8.ll b/test/CodeGen/X86/x86-64-pic-8.ll
index d3b567c610..db35c33623 100644
--- a/test/CodeGen/X86/x86-64-pic-8.ll
+++ b/test/CodeGen/X86/x86-64-pic-8.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {leaq f(%rip),} %t1
+; RUN: grep "leaq f(%rip)," %t1
; RUN: not grep GOTPCREL %t1
define void ()* @g() {
diff --git a/test/CodeGen/X86/x86-64-pic-9.ll b/test/CodeGen/X86/x86-64-pic-9.ll
index 076103133f..6daea84e1a 100644
--- a/test/CodeGen/X86/x86-64-pic-9.ll
+++ b/test/CodeGen/X86/x86-64-pic-9.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
-; RUN: grep {leaq f(%rip),} %t1
+; RUN: grep "leaq f(%rip)," %t1
; RUN: not grep GOTPCREL %t1
define void ()* @g() nounwind {
diff --git a/test/CodeGen/XCore/mkmsk.ll b/test/CodeGen/XCore/mkmsk.ll
new file mode 100644
index 0000000000..377612b7d2
--- /dev/null
+++ b/test/CodeGen/XCore/mkmsk.ll
@@ -0,0 +1,11 @@
+; RUN: llc < %s -march=xcore | FileCheck %s
+
+define i32 @f(i32) nounwind {
+; CHECK: f:
+; CHECK: mkmsk r0, r0
+; CHECK-NEXT: retsp 0
+entry:
+ %1 = shl i32 1, %0
+ %2 = add i32 %1, -1
+ ret i32 %2
+}