From 1ce9e00f8b449be9bcf34d16fadaacf074a16362 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 19 Apr 2008 22:29:10 +0000 Subject: rename *.llx -> *.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49970 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../CBackend/2003-06-28-LinkOnceGlobalVars.ll | 3 ++ .../CBackend/2003-06-28-LinkOnceGlobalVars.llx | 3 -- .../CBackend/2004-02-13-FrameReturnAddress.ll | 16 +++++++ .../CBackend/2004-02-13-FrameReturnAddress.llx | 16 ------- .../CBackend/2004-02-15-PreexistingExternals.ll | 18 ++++++++ .../CBackend/2004-02-15-PreexistingExternals.llx | 18 -------- .../CBackend/2004-02-26-FPNotPrintableConstants.ll | 11 +++++ .../2004-02-26-FPNotPrintableConstants.llx | 11 ----- .../CBackend/2004-02-26-LinkOnceFunctions.ll | 6 +++ .../CBackend/2004-02-26-LinkOnceFunctions.llx | 6 --- .../CBackend/2004-11-13-FunctionPointerCast.ll | 12 +++++ .../CBackend/2004-11-13-FunctionPointerCast.llx | 12 ----- test/CodeGen/Generic/2004-02-08-UnwindSupport.ll | 17 +++++++ test/CodeGen/Generic/2004-02-08-UnwindSupport.llx | 17 ------- .../Generic/2004-05-09-LiveVarPartialRegister.ll | 13 ++++++ .../Generic/2004-05-09-LiveVarPartialRegister.llx | 13 ------ test/CodeGen/Generic/BasicInstrs.ll | 54 ++++++++++++++++++++++ test/CodeGen/Generic/BasicInstrs.llx | 54 ---------------------- test/CodeGen/Generic/ConstantExprLowering.ll | 22 +++++++++ test/CodeGen/Generic/ConstantExprLowering.llx | 22 --------- test/CodeGen/X86/2002-12-23-LocalRAProblem.ll | 15 ++++++ test/CodeGen/X86/2002-12-23-LocalRAProblem.llx | 15 ------ test/CodeGen/X86/2002-12-23-SubProblem.ll | 7 +++ test/CodeGen/X86/2002-12-23-SubProblem.llx | 7 --- test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll | 18 ++++++++ test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx | 18 -------- test/CodeGen/X86/2003-08-23-DeadBlockTest.ll | 12 +++++ test/CodeGen/X86/2003-08-23-DeadBlockTest.llx | 12 ----- test/CodeGen/X86/2003-11-03-GlobalBool.ll | 4 ++ test/CodeGen/X86/2003-11-03-GlobalBool.llx | 4 -- test/CodeGen/X86/2004-02-12-Memcpy.ll | 25 ++++++++++ test/CodeGen/X86/2004-02-12-Memcpy.llx | 25 ---------- test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll | 16 +++++++ test/CodeGen/X86/2004-02-13-FrameReturnAddress.llx | 16 ------- .../X86/2004-02-14-InefficientStackPointer.ll | 5 ++ .../X86/2004-02-14-InefficientStackPointer.llx | 5 -- test/CodeGen/X86/2004-02-22-Casts.ll | 12 +++++ test/CodeGen/X86/2004-02-22-Casts.llx | 12 ----- test/CodeGen/X86/2004-03-30-Select-Max.ll | 8 ++++ test/CodeGen/X86/2004-03-30-Select-Max.llx | 8 ---- test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll | 13 ++++++ .../CodeGen/X86/2004-04-09-SameValueCoalescing.llx | 13 ------ test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll | 7 +++ test/CodeGen/X86/2004-04-13-FPCMOV-Crash.llx | 7 --- test/CodeGen/X86/2004-06-10-StackifierCrash.ll | 6 +++ test/CodeGen/X86/2004-06-10-StackifierCrash.llx | 6 --- test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll | 8 ++++ test/CodeGen/X86/2004-10-08-SelectSetCCFold.llx | 8 ---- test/CodeGen/X86/compare_folding.ll | 11 +++++ test/CodeGen/X86/compare_folding.llx | 11 ----- test/CodeGen/X86/fp_constant_op.ll | 35 ++++++++++++++ test/CodeGen/X86/fp_constant_op.llx | 35 -------------- test/CodeGen/X86/fp_load_cast_fold.ll | 20 ++++++++ test/CodeGen/X86/fp_load_cast_fold.llx | 20 -------- test/CodeGen/X86/fp_load_fold.ll | 40 ++++++++++++++++ test/CodeGen/X86/fp_load_fold.llx | 40 ---------------- test/CodeGen/X86/shift-double.ll | 41 ++++++++++++++++ test/CodeGen/X86/shift-double.llx | 41 ---------------- 58 files changed, 475 insertions(+), 475 deletions(-) create mode 100644 test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.ll delete mode 100644 test/CodeGen/CBackend/2003-06-28-LinkOnceGlobalVars.llx create mode 100644 test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.ll delete mode 100644 test/CodeGen/CBackend/2004-02-13-FrameReturnAddress.llx create mode 100644 test/CodeGen/CBackend/2004-02-15-PreexistingExternals.ll delete mode 100644 test/CodeGen/CBackend/2004-02-15-PreexistingExternals.llx create mode 100644 test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.ll delete mode 100644 test/CodeGen/CBackend/2004-02-26-FPNotPrintableConstants.llx create mode 100644 test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.ll delete mode 100644 test/CodeGen/CBackend/2004-02-26-LinkOnceFunctions.llx create mode 100644 test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.ll delete mode 100644 test/CodeGen/CBackend/2004-11-13-FunctionPointerCast.llx create mode 100644 test/CodeGen/Generic/2004-02-08-UnwindSupport.ll delete mode 100644 test/CodeGen/Generic/2004-02-08-UnwindSupport.llx create mode 100644 test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.ll delete mode 100644 test/CodeGen/Generic/2004-05-09-LiveVarPartialRegister.llx create mode 100644 test/CodeGen/Generic/BasicInstrs.ll delete mode 100644 test/CodeGen/Generic/BasicInstrs.llx create mode 100644 test/CodeGen/Generic/ConstantExprLowering.ll delete mode 100644 test/CodeGen/Generic/ConstantExprLowering.llx create mode 100644 test/CodeGen/X86/2002-12-23-LocalRAProblem.ll delete mode 100644 test/CodeGen/X86/2002-12-23-LocalRAProblem.llx create mode 100644 test/CodeGen/X86/2002-12-23-SubProblem.ll delete mode 100644 test/CodeGen/X86/2002-12-23-SubProblem.llx create mode 100644 test/CodeGen/X86/2003-08-03-CallArgLiveRanges.ll delete mode 100644 test/CodeGen/X86/2003-08-03-CallArgLiveRanges.llx create mode 100644 test/CodeGen/X86/2003-08-23-DeadBlockTest.ll delete mode 100644 test/CodeGen/X86/2003-08-23-DeadBlockTest.llx create mode 100644 test/CodeGen/X86/2003-11-03-GlobalBool.ll delete mode 100644 test/CodeGen/X86/2003-11-03-GlobalBool.llx create mode 100644 test/CodeGen/X86/2004-02-12-Memcpy.ll delete mode 100644 test/CodeGen/X86/2004-02-12-Memcpy.llx create mode 100644 test/CodeGen/X86/2004-02-13-FrameReturnAddress.ll delete mode 100644 test/CodeGen/X86/2004-02-13-FrameReturnAddress.llx create mode 100644 test/CodeGen/X86/2004-02-14-InefficientStackPointer.ll delete mode 100644 test/CodeGen/X86/2004-02-14-InefficientStackPointer.llx create mode 100644 test/CodeGen/X86/2004-02-22-Casts.ll delete mode 100644 test/CodeGen/X86/2004-02-22-Casts.llx create mode 100644 test/CodeGen/X86/2004-03-30-Select-Max.ll delete mode 100644 test/CodeGen/X86/2004-03-30-Select-Max.llx create mode 100644 test/CodeGen/X86/2004-04-09-SameValueCoalescing.ll delete mode 100644 test/CodeGen/X86/2004-04-09-SameValueCoalescing.llx create mode 100644 test/CodeGen/X86/2004-04-13-FPCMOV-Crash.ll delete mode 100644 test/CodeGen/X86/2004-04-13-FPCMOV-Crash.llx create mode 100644 test/CodeGen/X86/2004-06-10-StackifierCrash.ll delete mode 100644 test/CodeGen/X86/2004-06-10-StackifierCrash.llx create mode 100644 test/CodeGen/X86/2004-10-08-SelectSetCCFold.ll delete mode 100644 test/CodeGen/X86/2004-10-08-SelectSetCCFold.llx create mode 100644 test/CodeGen/X86/compare_folding.ll delete mode 100644 test/CodeGen/X86/compare_folding.llx create mode 100644 test/CodeGen/X86/fp_constant_op.ll delete mode 100644 test/CodeGen/X86/fp_constant_op.llx create mode 100644 test/CodeGen/X86/fp_load_cast_fold.ll delete mode 100644 test/CodeGen/X86/fp_load_cast_fold.llx create mode 100644 test/CodeGen/X86/fp_load_fold.ll delete mode 100644 test/CodeGen/X86/fp_load_fold.llx create mode 100644 test/CodeGen/X86/shift-double.ll delete mode 100644 test/CodeGen/X86/shift-double.llx (limited to 'test') 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 0000000..ef3b579 --- /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 ef3b579..0000000 --- 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 0000000..911d6d4 --- /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 911d6d4..0000000 --- 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 0000000..1629deb --- /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 1629deb..0000000 --- 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 0000000..6f23915 --- /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 6f23915..0000000 --- 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 0000000..2d62231 --- /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 2d62231..0000000 --- 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 0000000..a8ee438 --- /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 a8ee438..0000000 --- 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 0000000..10d4069 --- /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 10d4069..0000000 --- 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 0000000..1f58ce1 --- /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 1f58ce1..0000000 --- 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 0000000..e65cbf7 --- /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 e65cbf7..0000000 --- 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 0000000..d265415 --- /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 d265415..0000000 --- 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 0000000..df4a8f5 --- /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 df4a8f5..0000000 --- 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 0000000..68200ff --- /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 68200ff..0000000 --- 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 0000000..2b4242a --- /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 2b4242a..0000000 --- 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 0000000..a4d5589 --- /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 a4d5589..0000000 --- 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 0000000..4de3c79 --- /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 4de3c79..0000000 --- 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 0000000..59364c1 --- /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 59364c1..0000000 --- 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 0000000..f48b1d3 --- /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 f48b1d3..0000000 --- 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 0000000..b25dfaf --- /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 b25dfaf..0000000 --- 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 0000000..40d5f39 --- /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 40d5f39..0000000 --- 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 0000000..5021fd8 --- /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 5021fd8..0000000 --- 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 0000000..633a615 --- /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 633a615..0000000 --- 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 0000000..858605c --- /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 858605c..0000000 --- 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 0000000..1a51bee --- /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 1a51bee..0000000 --- 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 0000000..9ee773c --- /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 9ee773c..0000000 --- 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 0000000..c6cda4a --- /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 c6cda4a..0000000 --- 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 0000000..ed02c6a --- /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 ed02c6a..0000000 --- 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 0000000..5452326 --- /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 5452326..0000000 --- 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 0000000..7c33cb3 --- /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 7c33cb3..0000000 --- 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 0000000..24017fe --- /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 24017fe..0000000 --- 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 -} - -- cgit v1.1