From: Chris Lattner Date: Sat, 19 Apr 2008 22:29:10 +0000 (+0000) Subject: rename *.llx -> *.ll X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=1ce9e00f8b449be9bcf34d16fadaacf074a16362;p=oota-llvm.git rename *.llx -> *.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49970 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll b/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll new file mode 100644 index 00000000000..ef3b579b5b4 --- /dev/null +++ b/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll @@ -0,0 +1,3 @@ +; RUN: llvm-as < %s | llc -march=c | grep common | grep X + +@X = linkonce global i32 5 diff --git a/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.llx b/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.llx deleted file mode 100644 index ef3b579b5b4..00000000000 --- a/test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.llx +++ /dev/null @@ -1,3 +0,0 @@ -; RUN: llvm-as < %s | llc -march=c | grep common | grep X - -@X = linkonce global i32 5 diff --git a/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll b/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll new file mode 100644 index 00000000000..911d6d4e9f5 --- /dev/null +++ b/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=c | grep builtin_return_address + +declare i8* @llvm.returnaddress(i32) + +declare i8* @llvm.frameaddress(i32) + +define i8* @test1() { + %X = call i8* @llvm.returnaddress( i32 0 ) ; [#uses=1] + ret i8* %X +} + +define i8* @test2() { + %X = call i8* @llvm.frameaddress( i32 0 ) ; [#uses=1] + ret i8* %X +} + diff --git a/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.llx b/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.llx deleted file mode 100644 index 911d6d4e9f5..00000000000 --- a/test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.llx +++ /dev/null @@ -1,16 +0,0 @@ -; RUN: llvm-as < %s | llc -march=c | grep builtin_return_address - -declare i8* @llvm.returnaddress(i32) - -declare i8* @llvm.frameaddress(i32) - -define i8* @test1() { - %X = call i8* @llvm.returnaddress( i32 0 ) ; [#uses=1] - ret i8* %X -} - -define i8* @test2() { - %X = call i8* @llvm.frameaddress( i32 0 ) ; [#uses=1] - ret i8* %X -} - diff --git a/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll b/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll new file mode 100644 index 00000000000..1629debc58f --- /dev/null +++ b/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll @@ -0,0 +1,18 @@ +; The intrinsic lowering pass was lowering intrinsics like llvm.memcpy to +; explicitly specified prototypes, inserting a new function if the old one +; didn't exist. This caused there to be two external memcpy functions in +; this testcase for example, which caused the CBE to mangle one, screwing +; everything up. :( Test that this does not happen anymore. +; +; RUN: llvm-as < %s | llc -march=c | not grep _memcpy + +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) + +declare float* @memcpy(i32*, i32, i32) + +define i32 @test(i8* %A, i8* %B, i32* %C) { + call float* @memcpy( i32* %C, i32 4, i32 17 ) ; :1 [#uses=0] + call void @llvm.memcpy.i32( i8* %A, i8* %B, i32 123, i32 14 ) + ret i32 7 +} + diff --git a/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.llx b/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.llx deleted file mode 100644 index 1629debc58f..00000000000 --- a/test/CodeGen/CBackend/2004-02-15-PreexistingExternals.llx +++ /dev/null @@ -1,18 +0,0 @@ -; The intrinsic lowering pass was lowering intrinsics like llvm.memcpy to -; explicitly specified prototypes, inserting a new function if the old one -; didn't exist. This caused there to be two external memcpy functions in -; this testcase for example, which caused the CBE to mangle one, screwing -; everything up. :( Test that this does not happen anymore. -; -; RUN: llvm-as < %s | llc -march=c | not grep _memcpy - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -declare float* @memcpy(i32*, i32, i32) - -define i32 @test(i8* %A, i8* %B, i32* %C) { - call float* @memcpy( i32* %C, i32 4, i32 17 ) ; :1 [#uses=0] - call void @llvm.memcpy.i32( i8* %A, i8* %B, i32 123, i32 14 ) - ret i32 7 -} - diff --git a/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll b/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll new file mode 100644 index 00000000000..6f23915a75c --- /dev/null +++ b/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll @@ -0,0 +1,11 @@ +; This is a non-normal FP value +; RUN: llvm-as < %s | llc -march=c | grep FPConstant | grep static + +define float @func() { + ret float 0xFFF0000000000000 +} + +define double @func2() { + ret double 0xFF20000000000000 +} + diff --git a/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.llx b/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.llx deleted file mode 100644 index 6f23915a75c..00000000000 --- a/test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.llx +++ /dev/null @@ -1,11 +0,0 @@ -; This is a non-normal FP value -; RUN: llvm-as < %s | llc -march=c | grep FPConstant | grep static - -define float @func() { - ret float 0xFFF0000000000000 -} - -define double @func2() { - ret double 0xFF20000000000000 -} - diff --git a/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll b/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll new file mode 100644 index 00000000000..2d62231b74e --- /dev/null +++ b/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=c | grep func1 | grep WEAK + +define linkonce i32 @func1() { + ret i32 5 +} + diff --git a/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.llx b/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.llx deleted file mode 100644 index 2d62231b74e..00000000000 --- a/test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.llx +++ /dev/null @@ -1,6 +0,0 @@ -; RUN: llvm-as < %s | llc -march=c | grep func1 | grep WEAK - -define linkonce i32 @func1() { - ret i32 5 -} - diff --git a/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll b/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll new file mode 100644 index 00000000000..a8ee438cc43 --- /dev/null +++ b/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll @@ -0,0 +1,12 @@ +; The CBE should not emit code that casts the function pointer. This causes +; GCC to get testy and insert trap instructions instead of doing the right +; thing. :( +; RUN: llvm-as < %s | llc -march=c + +declare void @external(i8*) + +define i32 @test(i32* %X) { + %RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; [#uses=1] + ret i32 %RV +} + diff --git a/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.llx b/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.llx deleted file mode 100644 index a8ee438cc43..00000000000 --- a/test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.llx +++ /dev/null @@ -1,12 +0,0 @@ -; The CBE should not emit code that casts the function pointer. This causes -; GCC to get testy and insert trap instructions instead of doing the right -; thing. :( -; RUN: llvm-as < %s | llc -march=c - -declare void @external(i8*) - -define i32 @test(i32* %X) { - %RV = call i32 bitcast (void (i8*)* @external to i32 (i32*)*)( i32* %X ) ; [#uses=1] - ret i32 %RV -} - diff --git a/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll b/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll new file mode 100644 index 00000000000..10d40693d8e --- /dev/null +++ b/test/CodeGen/Generic/2004-02-08-UnwindSupport.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | llc -enable-correct-eh-support + +define i32 @test() { + unwind +} + +define i32 @main() { + %X = invoke i32 @test( ) + to label %cont unwind label %EH ; [#uses=0] + +cont: ; preds = %0 + ret i32 1 + +EH: ; preds = %0 + ret i32 0 +} + diff --git a/test/CodeGen/Generic/2004-02-08-UnwindSupport.llx b/test/CodeGen/Generic/2004-02-08-UnwindSupport.llx deleted file mode 100644 index 10d40693d8e..00000000000 --- a/test/CodeGen/Generic/2004-02-08-UnwindSupport.llx +++ /dev/null @@ -1,17 +0,0 @@ -; RUN: llvm-as < %s | llc -enable-correct-eh-support - -define i32 @test() { - unwind -} - -define i32 @main() { - %X = invoke i32 @test( ) - to label %cont unwind label %EH ; [#uses=0] - -cont: ; preds = %0 - ret i32 1 - -EH: ; preds = %0 - ret i32 0 -} - diff --git a/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll b/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll new file mode 100644 index 00000000000..1f58ce11fe7 --- /dev/null +++ b/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | llc +@global_long_1 = linkonce global i64 7 ; [#uses=1] +@global_long_2 = linkonce global i64 49 ; [#uses=1] + +define i32 @main() { + %l1 = load i64* @global_long_1 ; [#uses=1] + %l2 = load i64* @global_long_2 ; [#uses=1] + %cond = icmp sle i64 %l1, %l2 ; [#uses=1] + %cast2 = zext i1 %cond to i32 ; [#uses=1] + %RV = sub i32 1, %cast2 ; [#uses=1] + ret i32 %RV +} + diff --git a/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx b/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx deleted file mode 100644 index 1f58ce11fe7..00000000000 --- a/test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx +++ /dev/null @@ -1,13 +0,0 @@ -; RUN: llvm-as < %s | llc -@global_long_1 = linkonce global i64 7 ; [#uses=1] -@global_long_2 = linkonce global i64 49 ; [#uses=1] - -define i32 @main() { - %l1 = load i64* @global_long_1 ; [#uses=1] - %l2 = load i64* @global_long_2 ; [#uses=1] - %cond = icmp sle i64 %l1, %l2 ; [#uses=1] - %cast2 = zext i1 %cond to i32 ; [#uses=1] - %RV = sub i32 1, %cast2 ; [#uses=1] - ret i32 %RV -} - diff --git a/test/CodeGen/Generic/BasicInstrs.ll b/test/CodeGen/Generic/BasicInstrs.ll new file mode 100644 index 00000000000..e65cbf772fd --- /dev/null +++ b/test/CodeGen/Generic/BasicInstrs.ll @@ -0,0 +1,54 @@ +; New testcase, this contains a bunch of simple instructions that should be +; handled by a code generator. + +; RUN: llvm-as < %s | llc + +define i32 @add(i32 %A, i32 %B) { + %R = add i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @sub(i32 %A, i32 %B) { + %R = sub i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @mul(i32 %A, i32 %B) { + %R = mul i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @sdiv(i32 %A, i32 %B) { + %R = sdiv i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @udiv(i32 %A, i32 %B) { + %R = udiv i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @srem(i32 %A, i32 %B) { + %R = srem i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @urem(i32 %A, i32 %B) { + %R = urem i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @and(i32 %A, i32 %B) { + %R = and i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @or(i32 %A, i32 %B) { + %R = or i32 %A, %B ; [#uses=1] + ret i32 %R +} + +define i32 @xor(i32 %A, i32 %B) { + %R = xor i32 %A, %B ; [#uses=1] + ret i32 %R +} diff --git a/test/CodeGen/Generic/BasicInstrs.llx b/test/CodeGen/Generic/BasicInstrs.llx deleted file mode 100644 index e65cbf772fd..00000000000 --- a/test/CodeGen/Generic/BasicInstrs.llx +++ /dev/null @@ -1,54 +0,0 @@ -; New testcase, this contains a bunch of simple instructions that should be -; handled by a code generator. - -; RUN: llvm-as < %s | llc - -define i32 @add(i32 %A, i32 %B) { - %R = add i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @sub(i32 %A, i32 %B) { - %R = sub i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @mul(i32 %A, i32 %B) { - %R = mul i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @sdiv(i32 %A, i32 %B) { - %R = sdiv i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @udiv(i32 %A, i32 %B) { - %R = udiv i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @srem(i32 %A, i32 %B) { - %R = srem i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @urem(i32 %A, i32 %B) { - %R = urem i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @and(i32 %A, i32 %B) { - %R = and i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @or(i32 %A, i32 %B) { - %R = or i32 %A, %B ; [#uses=1] - ret i32 %R -} - -define i32 @xor(i32 %A, i32 %B) { - %R = xor i32 %A, %B ; [#uses=1] - ret i32 %R -} diff --git a/test/CodeGen/Generic/ConstantExprLowering.ll b/test/CodeGen/Generic/ConstantExprLowering.ll new file mode 100644 index 00000000000..d26541596da --- /dev/null +++ b/test/CodeGen/Generic/ConstantExprLowering.ll @@ -0,0 +1,22 @@ +; RUN: llvm-as < %s | llc + +@.str_1 = internal constant [16 x i8] c"%d %d %d %d %d\0A\00" ; <[16 x i8]*> [#uses=1] +@XA = external global i32 ; [#uses=1] +@XB = external global i32 ; [#uses=1] + +declare i32 @printf(i8*, ...) + +define void @test(i32 %A, i32 %B, i32 %C, i32 %D) { +entry: + %t1 = icmp slt i32 %A, 0 ; [#uses=1] + br i1 %t1, label %less, label %not_less + +less: ; preds = %entry + br label %not_less + +not_less: ; preds = %less, %entry + %t2 = phi i32 [ sub (i32 ptrtoint (i32* @XA to i32), i32 ptrtoint (i32* @XB to i32)), %less ], [ sub (i32 ptrtoint (i32* @XA to i32), i32 ptrtoint (i32* @XB to i32)), %entry ] ; [#uses=1] + %tmp.39 = call i32 (i8*, ...)* @printf( i8* getelementptr ([16 x i8]* @.str_1, i64 0, i64 0), i32 %t2 ) ; [#uses=0] + ret void +} + diff --git a/test/CodeGen/Generic/ConstantExprLowering.llx b/test/CodeGen/Generic/ConstantExprLowering.llx deleted file mode 100644 index d26541596da..00000000000 --- a/test/CodeGen/Generic/ConstantExprLowering.llx +++ /dev/null @@ -1,22 +0,0 @@ -; RUN: llvm-as < %s | llc - -@.str_1 = internal constant [16 x i8] c"%d %d %d %d %d\0A\00" ; <[16 x i8]*> [#uses=1] -@XA = external global i32 ; [#uses=1] -@XB = external global i32 ; [#uses=1] - -declare i32 @printf(i8*, ...) - -define void @test(i32 %A, i32 %B, i32 %C, i32 %D) { -entry: - %t1 = icmp slt i32 %A, 0 ; [#uses=1] - br i1 %t1, label %less, label %not_less - -less: ; preds = %entry - br label %not_less - -not_less: ; preds = %less, %entry - %t2 = phi i32 [ sub (i32 ptrtoint (i32* @XA to i32), i32 ptrtoint (i32* @XB to i32)), %less ], [ sub (i32 ptrtoint (i32* @XA to i32), i32 ptrtoint (i32* @XB to i32)), %entry ] ; [#uses=1] - %tmp.39 = call i32 (i8*, ...)* @printf( i8* getelementptr ([16 x i8]* @.str_1, i64 0, i64 0), i32 %t2 ) ; [#uses=0] - ret void -} - diff --git a/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll b/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll new file mode 100644 index 00000000000..df4a8f52f0b --- /dev/null +++ b/test/CodeGen/X86/2002-12-23-LocalRAProblem.ll @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple + +define i32 @main() { + ; %A = 0 + %A = add i32 0, 0 ; [#uses=1] + ; %B = 1 + %B = add i32 0, 1 ; [#uses=2] + br label %bb1 +bb1: ; preds = %0 + ; %X = 0*1 = 0 + %X = mul i32 %A, %B ; [#uses=0] + ; %r = 0 + %R = sub i32 %B, 1 ; [#uses=1] + ret i32 %R +} diff --git a/test/CodeGen/X86/2002-12-23-LocalRAProblem.llx b/test/CodeGen/X86/2002-12-23-LocalRAProblem.llx deleted file mode 100644 index df4a8f52f0b..00000000000 --- a/test/CodeGen/X86/2002-12-23-LocalRAProblem.llx +++ /dev/null @@ -1,15 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple - -define i32 @main() { - ; %A = 0 - %A = add i32 0, 0 ; [#uses=1] - ; %B = 1 - %B = add i32 0, 1 ; [#uses=2] - br label %bb1 -bb1: ; preds = %0 - ; %X = 0*1 = 0 - %X = mul i32 %A, %B ; [#uses=0] - ; %r = 0 - %R = sub i32 %B, 1 ; [#uses=1] - ret i32 %R -} diff --git a/test/CodeGen/X86/2002-12-23-SubProblem.ll b/test/CodeGen/X86/2002-12-23-SubProblem.ll new file mode 100644 index 00000000000..68200ff2349 --- /dev/null +++ b/test/CodeGen/X86/2002-12-23-SubProblem.ll @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple + +define i32 @main(i32 %B) { + ;%B = add i32 0, 1; + %R = sub i32 %B, 1 ; %r = 0 + ret i32 %R +} diff --git a/test/CodeGen/X86/2002-12-23-SubProblem.llx b/test/CodeGen/X86/2002-12-23-SubProblem.llx deleted file mode 100644 index 68200ff2349..00000000000 --- a/test/CodeGen/X86/2002-12-23-SubProblem.llx +++ /dev/null @@ -1,7 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -regalloc=simple - -define i32 @main(i32 %B) { - ;%B = add i32 0, 1; - %R = sub i32 %B, 1 ; %r = 0 - ret i32 %R -} diff --git a/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll b/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll new file mode 100644 index 00000000000..2b4242aaa15 --- /dev/null +++ b/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll @@ -0,0 +1,18 @@ +; The old instruction selector used to load all arguments to a call up in +; registers, then start pushing them all onto the stack. This is bad news as +; it makes a ton of annoying overlapping live ranges. This code should not +; cause spills! +; +; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep spilled + +target datalayout = "e-p:32:32" + +define i32 @test(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32) { + ret i32 0 +} + +define i32 @main() { + %X = call i32 @test( i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10 ) ; [#uses=1] + ret i32 %X +} + diff --git a/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx b/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx deleted file mode 100644 index 2b4242aaa15..00000000000 --- a/test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx +++ /dev/null @@ -1,18 +0,0 @@ -; The old instruction selector used to load all arguments to a call up in -; registers, then start pushing them all onto the stack. This is bad news as -; it makes a ton of annoying overlapping live ranges. This code should not -; cause spills! -; -; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep spilled - -target datalayout = "e-p:32:32" - -define i32 @test(i32, i32, i32, i32, i32, i32, i32, i32, i32, i32) { - ret i32 0 -} - -define i32 @main() { - %X = call i32 @test( i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10 ) ; [#uses=1] - ret i32 %X -} - diff --git a/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll b/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll new file mode 100644 index 00000000000..a4d558949e3 --- /dev/null +++ b/test/CodeGen/X86/2003-08-23-DeadBlockTest.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86 + +define i32 @test() { +entry: + ret i32 7 +Test: ; No predecessors! + %A = call i32 @test( ) ; [#uses=1] + %B = call i32 @test( ) ; [#uses=1] + %C = add i32 %A, %B ; [#uses=1] + ret i32 %C +} + diff --git a/test/CodeGen/X86/2003-08-23-DeadBlockTest.llx b/test/CodeGen/X86/2003-08-23-DeadBlockTest.llx deleted file mode 100644 index a4d558949e3..00000000000 --- a/test/CodeGen/X86/2003-08-23-DeadBlockTest.llx +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 - -define i32 @test() { -entry: - ret i32 7 -Test: ; No predecessors! - %A = call i32 @test( ) ; [#uses=1] - %B = call i32 @test( ) ; [#uses=1] - %C = add i32 %A, %B ; [#uses=1] - ret i32 %C -} - diff --git a/test/CodeGen/X86/2003-11-03-GlobalBool.ll b/test/CodeGen/X86/2003-11-03-GlobalBool.ll new file mode 100644 index 00000000000..4de3c79fdcb --- /dev/null +++ b/test/CodeGen/X86/2003-11-03-GlobalBool.ll @@ -0,0 +1,4 @@ +; RUN: llvm-as < %s | llc -march=x86 | \ +; RUN: not grep {.byte\[\[:space:\]\]*true} + +@X = global i1 true ; [#uses=0] diff --git a/test/CodeGen/X86/2003-11-03-GlobalBool.llx b/test/CodeGen/X86/2003-11-03-GlobalBool.llx deleted file mode 100644 index 4de3c79fdcb..00000000000 --- a/test/CodeGen/X86/2003-11-03-GlobalBool.llx +++ /dev/null @@ -1,4 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | \ -; RUN: not grep {.byte\[\[:space:\]\]*true} - -@X = global i1 true ; [#uses=0] diff --git a/test/CodeGen/X86/2004-02-12-Memcpy.ll b/test/CodeGen/X86/2004-02-12-Memcpy.ll new file mode 100644 index 00000000000..59364c1f6d6 --- /dev/null +++ b/test/CodeGen/X86/2004-02-12-Memcpy.ll @@ -0,0 +1,25 @@ +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 3 + +@A = global [32 x i32] zeroinitializer +@B = global [32 x i32] zeroinitializer + +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) + +define void @main() { + ; dword copy + call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*), + i8* bitcast ([32 x i32]* @B to i8*), + i32 128, i32 4 ) + + ; word copy + call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*), + i8* bitcast ([32 x i32]* @B to i8*), + i32 128, i32 2 ) + + ; byte copy + call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*), + i8* bitcast ([32 x i32]* @B to i8*), + i32 128, i32 1 ) + + ret void +} diff --git a/test/CodeGen/X86/2004-02-12-Memcpy.llx b/test/CodeGen/X86/2004-02-12-Memcpy.llx deleted file mode 100644 index 59364c1f6d6..00000000000 --- a/test/CodeGen/X86/2004-02-12-Memcpy.llx +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 3 - -@A = global [32 x i32] zeroinitializer -@B = global [32 x i32] zeroinitializer - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -define void @main() { - ; dword copy - call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*), - i8* bitcast ([32 x i32]* @B to i8*), - i32 128, i32 4 ) - - ; word copy - call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*), - i8* bitcast ([32 x i32]* @B to i8*), - i32 128, i32 2 ) - - ; byte copy - call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*), - i8* bitcast ([32 x i32]* @B to i8*), - i32 128, i32 1 ) - - ret void -} diff --git a/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll b/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll new file mode 100644 index 00000000000..f48b1d3adf0 --- /dev/null +++ b/test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep {(%esp} + +declare i8* @llvm.returnaddress(i32) + +declare i8* @llvm.frameaddress(i32) + +define i8* @test1() { + %X = call i8* @llvm.returnaddress( i32 0 ) ; [#uses=1] + ret i8* %X +} + +define i8* @test2() { + %X = call i8* @llvm.frameaddress( i32 0 ) ; [#uses=1] + ret i8* %X +} + diff --git a/test/CodeGen/X86/2004-02-13-FrameReturnAddress.llx b/test/CodeGen/X86/2004-02-13-FrameReturnAddress.llx deleted file mode 100644 index f48b1d3adf0..00000000000 --- a/test/CodeGen/X86/2004-02-13-FrameReturnAddress.llx +++ /dev/null @@ -1,16 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep {(%esp} - -declare i8* @llvm.returnaddress(i32) - -declare i8* @llvm.frameaddress(i32) - -define i8* @test1() { - %X = call i8* @llvm.returnaddress( i32 0 ) ; [#uses=1] - ret i8* %X -} - -define i8* @test2() { - %X = call i8* @llvm.frameaddress( i32 0 ) ; [#uses=1] - ret i8* %X -} - diff --git a/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll b/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll new file mode 100644 index 00000000000..b25dfaf5d90 --- /dev/null +++ b/test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll @@ -0,0 +1,5 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep -i ESP | not grep sub + +define i32 @test(i32 %X) { + ret i32 %X +} diff --git a/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx b/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx deleted file mode 100644 index b25dfaf5d90..00000000000 --- a/test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx +++ /dev/null @@ -1,5 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep -i ESP | not grep sub - -define i32 @test(i32 %X) { - ret i32 %X -} diff --git a/test/CodeGen/X86/2004-02-22-Casts.ll b/test/CodeGen/X86/2004-02-22-Casts.ll new file mode 100644 index 00000000000..40d5f39df64 --- /dev/null +++ b/test/CodeGen/X86/2004-02-22-Casts.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86 +define i1 @test1(double %X) { + %V = fcmp one double %X, 0.000000e+00 ; [#uses=1] + ret i1 %V +} + +define double @test2(i64 %X) { + %V = uitofp i64 %X to double ; [#uses=1] + ret double %V +} + + diff --git a/test/CodeGen/X86/2004-02-22-Casts.llx b/test/CodeGen/X86/2004-02-22-Casts.llx deleted file mode 100644 index 40d5f39df64..00000000000 --- a/test/CodeGen/X86/2004-02-22-Casts.llx +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -define i1 @test1(double %X) { - %V = fcmp one double %X, 0.000000e+00 ; [#uses=1] - ret i1 %V -} - -define double @test2(i64 %X) { - %V = uitofp i64 %X to double ; [#uses=1] - ret double %V -} - - diff --git a/test/CodeGen/X86/2004-03-30-Select-Max.ll b/test/CodeGen/X86/2004-03-30-Select-Max.ll new file mode 100644 index 00000000000..5021fd89dfe --- /dev/null +++ b/test/CodeGen/X86/2004-03-30-Select-Max.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=x86 | not grep {j\[lgbe\]} + +define i32 @max(i32 %A, i32 %B) { + %gt = icmp sgt i32 %A, %B ; [#uses=1] + %R = select i1 %gt, i32 %A, i32 %B ; [#uses=1] + ret i32 %R +} + diff --git a/test/CodeGen/X86/2004-03-30-Select-Max.llx b/test/CodeGen/X86/2004-03-30-Select-Max.llx deleted file mode 100644 index 5021fd89dfe..00000000000 --- a/test/CodeGen/X86/2004-03-30-Select-Max.llx +++ /dev/null @@ -1,8 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | not grep {j\[lgbe\]} - -define i32 @max(i32 %A, i32 %B) { - %gt = icmp sgt i32 %A, %B ; [#uses=1] - %R = select i1 %gt, i32 %A, i32 %B ; [#uses=1] - ret i32 %R -} - diff --git a/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll b/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll new file mode 100644 index 00000000000..633a6156455 --- /dev/null +++ b/test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll @@ -0,0 +1,13 @@ +; Linear scan does not currently coalesce any two variables that have +; overlapping live intervals. When two overlapping intervals have the same +; value, they can be joined though. +; +; RUN: llvm-as < %s | llc -march=x86 -regalloc=linearscan | \ +; RUN: not grep {mov %\[A-Z\]\\\{2,3\\\}, %\[A-Z\]\\\{2,3\\\}} + +define i64 @test(i64 %x) { +entry: + %tmp.1 = mul i64 %x, 4294967297 ; [#uses=1] + ret i64 %tmp.1 +} + diff --git a/test/CodeGen/X86/2004-04-09-SameValueCoalescing.llx b/test/CodeGen/X86/2004-04-09-SameValueCoalescing.llx deleted file mode 100644 index 633a6156455..00000000000 --- a/test/CodeGen/X86/2004-04-09-SameValueCoalescing.llx +++ /dev/null @@ -1,13 +0,0 @@ -; Linear scan does not currently coalesce any two variables that have -; overlapping live intervals. When two overlapping intervals have the same -; value, they can be joined though. -; -; RUN: llvm-as < %s | llc -march=x86 -regalloc=linearscan | \ -; RUN: not grep {mov %\[A-Z\]\\\{2,3\\\}, %\[A-Z\]\\\{2,3\\\}} - -define i64 @test(i64 %x) { -entry: - %tmp.1 = mul i64 %x, 4294967297 ; [#uses=1] - ret i64 %tmp.1 -} - diff --git a/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll b/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll new file mode 100644 index 00000000000..858605c231b --- /dev/null +++ b/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | llc -march=x86 + +define double @test(double %d) { + %X = select i1 false, double %d, double %d ; [#uses=1] + ret double %X +} + diff --git a/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.llx b/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.llx deleted file mode 100644 index 858605c231b..00000000000 --- a/test/CodeGen/X86/2004-04-13-FPCMOV-Crash.llx +++ /dev/null @@ -1,7 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 - -define double @test(double %d) { - %X = select i1 false, double %d, double %d ; [#uses=1] - ret double %X -} - diff --git a/test/CodeGen/X86/2004-06-10-StackifierCrash.ll b/test/CodeGen/X86/2004-06-10-StackifierCrash.ll new file mode 100644 index 00000000000..1a51bee404d --- /dev/null +++ b/test/CodeGen/X86/2004-06-10-StackifierCrash.ll @@ -0,0 +1,6 @@ +; RUN: llvm-as < %s | llc -march=x86 + +define i1 @T(double %X) { + %V = fcmp oeq double %X, %X ; [#uses=1] + ret i1 %V +} diff --git a/test/CodeGen/X86/2004-06-10-StackifierCrash.llx b/test/CodeGen/X86/2004-06-10-StackifierCrash.llx deleted file mode 100644 index 1a51bee404d..00000000000 --- a/test/CodeGen/X86/2004-06-10-StackifierCrash.llx +++ /dev/null @@ -1,6 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 - -define i1 @T(double %X) { - %V = fcmp oeq double %X, %X ; [#uses=1] - ret i1 %V -} diff --git a/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll b/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll new file mode 100644 index 00000000000..9ee773c91a2 --- /dev/null +++ b/test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=x86 + +define i1 @test(i1 %C, i1 %D, i32 %X, i32 %Y) { + %E = icmp slt i32 %X, %Y ; [#uses=1] + %F = select i1 %C, i1 %D, i1 %E ; [#uses=1] + ret i1 %F +} + diff --git a/test/CodeGen/X86/2004-10-08-SelectSetCCFold.llx b/test/CodeGen/X86/2004-10-08-SelectSetCCFold.llx deleted file mode 100644 index 9ee773c91a2..00000000000 --- a/test/CodeGen/X86/2004-10-08-SelectSetCCFold.llx +++ /dev/null @@ -1,8 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 - -define i1 @test(i1 %C, i1 %D, i32 %X, i32 %Y) { - %E = icmp slt i32 %X, %Y ; [#uses=1] - %F = select i1 %C, i1 %D, i1 %E ; [#uses=1] - ret i1 %F -} - diff --git a/test/CodeGen/X86/compare_folding.ll b/test/CodeGen/X86/compare_folding.ll new file mode 100644 index 00000000000..c6cda4a5b97 --- /dev/null +++ b/test/CodeGen/X86/compare_folding.ll @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | \ +; RUN: grep movsd | count 1 +; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | \ +; RUN: grep ucomisd +declare i1 @llvm.isunordered.f64(double, double) + +define i1 @test1(double %X, double %Y) { + %COM = fcmp uno double %X, %Y ; [#uses=1] + ret i1 %COM +} + diff --git a/test/CodeGen/X86/compare_folding.llx b/test/CodeGen/X86/compare_folding.llx deleted file mode 100644 index c6cda4a5b97..00000000000 --- a/test/CodeGen/X86/compare_folding.llx +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | \ -; RUN: grep movsd | count 1 -; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | \ -; RUN: grep ucomisd -declare i1 @llvm.isunordered.f64(double, double) - -define i1 @test1(double %X, double %Y) { - %COM = fcmp uno double %X, %Y ; [#uses=1] - ret i1 %COM -} - diff --git a/test/CodeGen/X86/fp_constant_op.ll b/test/CodeGen/X86/fp_constant_op.ll new file mode 100644 index 00000000000..ed02c6a8f72 --- /dev/null +++ b/test/CodeGen/X86/fp_constant_op.ll @@ -0,0 +1,35 @@ +; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel -mcpu=i486 | \ +; RUN: grep {fadd\\|fsub\\|fdiv\\|fmul} | not grep -i ST + +; Test that the load of the constant is folded into the operation. + + +define double @foo_add(double %P) { + %tmp.1 = add double %P, 1.230000e+02 ; [#uses=1] + ret double %tmp.1 +} + +define double @foo_mul(double %P) { + %tmp.1 = mul double %P, 1.230000e+02 ; [#uses=1] + ret double %tmp.1 +} + +define double @foo_sub(double %P) { + %tmp.1 = sub double %P, 1.230000e+02 ; [#uses=1] + ret double %tmp.1 +} + +define double @foo_subr(double %P) { + %tmp.1 = sub double 1.230000e+02, %P ; [#uses=1] + ret double %tmp.1 +} + +define double @foo_div(double %P) { + %tmp.1 = fdiv double %P, 1.230000e+02 ; [#uses=1] + ret double %tmp.1 +} + +define double @foo_divr(double %P) { + %tmp.1 = fdiv double 1.230000e+02, %P ; [#uses=1] + ret double %tmp.1 +} diff --git a/test/CodeGen/X86/fp_constant_op.llx b/test/CodeGen/X86/fp_constant_op.llx deleted file mode 100644 index ed02c6a8f72..00000000000 --- a/test/CodeGen/X86/fp_constant_op.llx +++ /dev/null @@ -1,35 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel -mcpu=i486 | \ -; RUN: grep {fadd\\|fsub\\|fdiv\\|fmul} | not grep -i ST - -; Test that the load of the constant is folded into the operation. - - -define double @foo_add(double %P) { - %tmp.1 = add double %P, 1.230000e+02 ; [#uses=1] - ret double %tmp.1 -} - -define double @foo_mul(double %P) { - %tmp.1 = mul double %P, 1.230000e+02 ; [#uses=1] - ret double %tmp.1 -} - -define double @foo_sub(double %P) { - %tmp.1 = sub double %P, 1.230000e+02 ; [#uses=1] - ret double %tmp.1 -} - -define double @foo_subr(double %P) { - %tmp.1 = sub double 1.230000e+02, %P ; [#uses=1] - ret double %tmp.1 -} - -define double @foo_div(double %P) { - %tmp.1 = fdiv double %P, 1.230000e+02 ; [#uses=1] - ret double %tmp.1 -} - -define double @foo_divr(double %P) { - %tmp.1 = fdiv double 1.230000e+02, %P ; [#uses=1] - ret double %tmp.1 -} diff --git a/test/CodeGen/X86/fp_load_cast_fold.ll b/test/CodeGen/X86/fp_load_cast_fold.ll new file mode 100644 index 00000000000..54523265e91 --- /dev/null +++ b/test/CodeGen/X86/fp_load_cast_fold.ll @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep fild | not grep ESP + +define double @short(i16* %P) { + %V = load i16* %P ; [#uses=1] + %V2 = sitofp i16 %V to double ; [#uses=1] + ret double %V2 +} + +define double @int(i32* %P) { + %V = load i32* %P ; [#uses=1] + %V2 = sitofp i32 %V to double ; [#uses=1] + ret double %V2 +} + +define double @long(i64* %P) { + %V = load i64* %P ; [#uses=1] + %V2 = sitofp i64 %V to double ; [#uses=1] + ret double %V2 +} + diff --git a/test/CodeGen/X86/fp_load_cast_fold.llx b/test/CodeGen/X86/fp_load_cast_fold.llx deleted file mode 100644 index 54523265e91..00000000000 --- a/test/CodeGen/X86/fp_load_cast_fold.llx +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep fild | not grep ESP - -define double @short(i16* %P) { - %V = load i16* %P ; [#uses=1] - %V2 = sitofp i16 %V to double ; [#uses=1] - ret double %V2 -} - -define double @int(i32* %P) { - %V = load i32* %P ; [#uses=1] - %V2 = sitofp i32 %V to double ; [#uses=1] - ret double %V2 -} - -define double @long(i64* %P) { - %V = load i64* %P ; [#uses=1] - %V2 = sitofp i64 %V to double ; [#uses=1] - ret double %V2 -} - diff --git a/test/CodeGen/X86/fp_load_fold.ll b/test/CodeGen/X86/fp_load_fold.ll new file mode 100644 index 00000000000..7c33cb32bc6 --- /dev/null +++ b/test/CodeGen/X86/fp_load_fold.ll @@ -0,0 +1,40 @@ +; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \ +; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} + +; Test that the load of the memory location is folded into the operation. + +define double @test_add(double %X, double* %P) { + %Y = load double* %P ; [#uses=1] + %R = add double %X, %Y ; [#uses=1] + ret double %R +} + +define double @test_mul(double %X, double* %P) { + %Y = load double* %P ; [#uses=1] + %R = mul double %X, %Y ; [#uses=1] + ret double %R +} + +define double @test_sub(double %X, double* %P) { + %Y = load double* %P ; [#uses=1] + %R = sub double %X, %Y ; [#uses=1] + ret double %R +} + +define double @test_subr(double %X, double* %P) { + %Y = load double* %P ; [#uses=1] + %R = sub double %Y, %X ; [#uses=1] + ret double %R +} + +define double @test_div(double %X, double* %P) { + %Y = load double* %P ; [#uses=1] + %R = fdiv double %X, %Y ; [#uses=1] + ret double %R +} + +define double @test_divr(double %X, double* %P) { + %Y = load double* %P ; [#uses=1] + %R = fdiv double %Y, %X ; [#uses=1] + ret double %R +} diff --git a/test/CodeGen/X86/fp_load_fold.llx b/test/CodeGen/X86/fp_load_fold.llx deleted file mode 100644 index 7c33cb32bc6..00000000000 --- a/test/CodeGen/X86/fp_load_fold.llx +++ /dev/null @@ -1,40 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \ -; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul} - -; Test that the load of the memory location is folded into the operation. - -define double @test_add(double %X, double* %P) { - %Y = load double* %P ; [#uses=1] - %R = add double %X, %Y ; [#uses=1] - ret double %R -} - -define double @test_mul(double %X, double* %P) { - %Y = load double* %P ; [#uses=1] - %R = mul double %X, %Y ; [#uses=1] - ret double %R -} - -define double @test_sub(double %X, double* %P) { - %Y = load double* %P ; [#uses=1] - %R = sub double %X, %Y ; [#uses=1] - ret double %R -} - -define double @test_subr(double %X, double* %P) { - %Y = load double* %P ; [#uses=1] - %R = sub double %Y, %X ; [#uses=1] - ret double %R -} - -define double @test_div(double %X, double* %P) { - %Y = load double* %P ; [#uses=1] - %R = fdiv double %X, %Y ; [#uses=1] - ret double %R -} - -define double @test_divr(double %X, double* %P) { - %Y = load double* %P ; [#uses=1] - %R = fdiv double %Y, %X ; [#uses=1] - ret double %R -} diff --git a/test/CodeGen/X86/shift-double.ll b/test/CodeGen/X86/shift-double.ll new file mode 100644 index 00000000000..24017fe2178 --- /dev/null +++ b/test/CodeGen/X86/shift-double.ll @@ -0,0 +1,41 @@ +; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \ +; RUN: grep {sh\[lr\]d} | count 5 + +define i64 @test1(i64 %X, i8 %C) { + %shift.upgrd.1 = zext i8 %C to i64 ; [#uses=1] + %Y = shl i64 %X, %shift.upgrd.1 ; [#uses=1] + ret i64 %Y +} + +define i64 @test2(i64 %X, i8 %C) { + %shift.upgrd.2 = zext i8 %C to i64 ; [#uses=1] + %Y = ashr i64 %X, %shift.upgrd.2 ; [#uses=1] + ret i64 %Y +} + +define i64 @test3(i64 %X, i8 %C) { + %shift.upgrd.3 = zext i8 %C to i64 ; [#uses=1] + %Y = lshr i64 %X, %shift.upgrd.3 ; [#uses=1] + ret i64 %Y +} + +define i32 @test4(i32 %A, i32 %B, i8 %C) { + %shift.upgrd.4 = zext i8 %C to i32 ; [#uses=1] + %X = shl i32 %A, %shift.upgrd.4 ; [#uses=1] + %Cv = sub i8 32, %C ; [#uses=1] + %shift.upgrd.5 = zext i8 %Cv to i32 ; [#uses=1] + %Y = lshr i32 %B, %shift.upgrd.5 ; [#uses=1] + %Z = or i32 %Y, %X ; [#uses=1] + ret i32 %Z +} + +define i16 @test5(i16 %A, i16 %B, i8 %C) { + %shift.upgrd.6 = zext i8 %C to i16 ; [#uses=1] + %X = shl i16 %A, %shift.upgrd.6 ; [#uses=1] + %Cv = sub i8 16, %C ; [#uses=1] + %shift.upgrd.7 = zext i8 %Cv to i16 ; [#uses=1] + %Y = lshr i16 %B, %shift.upgrd.7 ; [#uses=1] + %Z = or i16 %Y, %X ; [#uses=1] + ret i16 %Z +} + diff --git a/test/CodeGen/X86/shift-double.llx b/test/CodeGen/X86/shift-double.llx deleted file mode 100644 index 24017fe2178..00000000000 --- a/test/CodeGen/X86/shift-double.llx +++ /dev/null @@ -1,41 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | \ -; RUN: grep {sh\[lr\]d} | count 5 - -define i64 @test1(i64 %X, i8 %C) { - %shift.upgrd.1 = zext i8 %C to i64 ; [#uses=1] - %Y = shl i64 %X, %shift.upgrd.1 ; [#uses=1] - ret i64 %Y -} - -define i64 @test2(i64 %X, i8 %C) { - %shift.upgrd.2 = zext i8 %C to i64 ; [#uses=1] - %Y = ashr i64 %X, %shift.upgrd.2 ; [#uses=1] - ret i64 %Y -} - -define i64 @test3(i64 %X, i8 %C) { - %shift.upgrd.3 = zext i8 %C to i64 ; [#uses=1] - %Y = lshr i64 %X, %shift.upgrd.3 ; [#uses=1] - ret i64 %Y -} - -define i32 @test4(i32 %A, i32 %B, i8 %C) { - %shift.upgrd.4 = zext i8 %C to i32 ; [#uses=1] - %X = shl i32 %A, %shift.upgrd.4 ; [#uses=1] - %Cv = sub i8 32, %C ; [#uses=1] - %shift.upgrd.5 = zext i8 %Cv to i32 ; [#uses=1] - %Y = lshr i32 %B, %shift.upgrd.5 ; [#uses=1] - %Z = or i32 %Y, %X ; [#uses=1] - ret i32 %Z -} - -define i16 @test5(i16 %A, i16 %B, i8 %C) { - %shift.upgrd.6 = zext i8 %C to i16 ; [#uses=1] - %X = shl i16 %A, %shift.upgrd.6 ; [#uses=1] - %Cv = sub i8 16, %C ; [#uses=1] - %shift.upgrd.7 = zext i8 %Cv to i16 ; [#uses=1] - %Y = lshr i16 %B, %shift.upgrd.7 ; [#uses=1] - %Z = or i16 %Y, %X ; [#uses=1] - ret i16 %Z -} -