[llvm-commits] [llvm] r164211 - in /llvm/trunk/test: CodeGen/SPARC/load_to_switch.ll Transforms/CodeGenPrepare/load_to_switch.ll

Hans Wennborg hans at hanshq.net
Wed Sep 19 02:25:03 PDT 2012


Author: hans
Date: Wed Sep 19 04:25:03 2012
New Revision: 164211

URL: http://llvm.org/viewvc/llvm-project?rev=164211&view=rev
Log:
Move load_to_switch.ll to test/CodeGen/SPARC/

Because the test invokes llc -march=sparc, it needs to be in a directory
which is only run when the sparc target is built.

Added:
    llvm/trunk/test/CodeGen/SPARC/load_to_switch.ll
      - copied, changed from r164207, llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll
Removed:
    llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll

Copied: llvm/trunk/test/CodeGen/SPARC/load_to_switch.ll (from r164207, llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/load_to_switch.ll?p2=llvm/trunk/test/CodeGen/SPARC/load_to_switch.ll&p1=llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll&r1=164207&r2=164211&rev=164211&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/load_to_switch.ll Wed Sep 19 04:25:03 2012
@@ -1,4 +1,4 @@
-; RUN: llc -march=sparc  < %s | FileCheck %s
+; RUN: llc -march=sparc < %s | FileCheck %s
 
 ; Check that all the switches turned into lookup tables by SimplifyCFG are
 ; turned back into switches for targets that don't like lookup tables.

Removed: llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll?rev=164210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll (original)
+++ llvm/trunk/test/Transforms/CodeGenPrepare/load_to_switch.ll (removed)
@@ -1,84 +0,0 @@
-; RUN: llc -march=sparc  < %s | FileCheck %s
-
-; Check that all the switches turned into lookup tables by SimplifyCFG are
-; turned back into switches for targets that don't like lookup tables.
-
- at .str = private unnamed_addr constant [4 x i8] c"foo\00", align 1
- at .str1 = private unnamed_addr constant [4 x i8] c"bar\00", align 1
- at .str2 = private unnamed_addr constant [4 x i8] c"baz\00", align 1
- at .str3 = private unnamed_addr constant [4 x i8] c"qux\00", align 1
- at .str4 = private unnamed_addr constant [6 x i8] c"error\00", align 1
- at switch.table = private unnamed_addr constant [7 x i32] [i32 55, i32 123, i32 0, i32 -1, i32 27, i32 62, i32 1]
- at switch.table1 = private unnamed_addr constant [4 x i8] c"*\09X\05"
- at switch.table2 = private unnamed_addr constant [4 x float] [float 0x40091EB860000000, float 0x3FF3BE76C0000000, float 0x4012449BA0000000, float 0x4001AE1480000000]
- at switch.table3 = private unnamed_addr constant [4 x i8*] [i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str3, i64 0, i64 0)]
-
-define i32 @f(i32 %c)  {
-entry:
-  %switch.tableidx = sub i32 %c, 42
-  %0 = icmp ult i32 %switch.tableidx, 7
-  br i1 %0, label %switch.lookup, label %return
-
-switch.lookup:
-  %switch.gep = getelementptr inbounds [7 x i32]* @switch.table, i32 0, i32 %switch.tableidx
-  %switch.load = load i32* %switch.gep
-  ret i32 %switch.load
-
-return:
-  ret i32 15
-
-; CHECK: f:
-; CHECK: %switch.lookup
-; CHECK-NOT: sethi %hi(.Lswitch.table)
-}
-
-declare void @dummy(i8 signext, float)
-
-define void @h(i32 %x) {
-entry:
-  %switch.tableidx = sub i32 %x, 0
-  %0 = icmp ult i32 %switch.tableidx, 4
-  br i1 %0, label %switch.lookup, label %sw.epilog
-
-switch.lookup:
-  %switch.gep = getelementptr inbounds [4 x i8]* @switch.table1, i32 0, i32 %switch.tableidx
-  %switch.load = load i8* %switch.gep
-  %switch.gep1 = getelementptr inbounds [4 x float]* @switch.table2, i32 0, i32 %switch.tableidx
-  %switch.load2 = load float* %switch.gep1
-  br label %sw.epilog
-
-sw.epilog:
-  %a.0 = phi i8 [ %switch.load, %switch.lookup ], [ 7, %entry ]
-  %b.0 = phi float [ %switch.load2, %switch.lookup ], [ 0x4023FAE140000000, %entry ]
-  call void @dummy(i8 signext %a.0, float %b.0)
-  ret void
-
-; CHECK: h:
-; CHECK: %switch.lookup
-; CHECK-NOT: sethi %hi(.Lswitch.table{{[0-9]}})
-; CHECK-NOT: sethi %hi(.Lswitch.table{{[0-9]}})
-}
-
-define i8* @foostring(i32 %x) {
-entry:
-  %switch.tableidx = sub i32 %x, 0
-  %0 = icmp ult i32 %switch.tableidx, 4
-  br i1 %0, label %switch.lookup, label %return
-
-switch.lookup:
-  %switch.gep = getelementptr inbounds [4 x i8*]* @switch.table3, i32 0, i32 %switch.tableidx
-  %switch.load = load i8** %switch.gep
-  ret i8* %switch.load
-
-return:
-  ret i8* getelementptr inbounds ([6 x i8]* @.str4, i64 0, i64 0)
-
-; CHECK: foostring:
-; CHECK: %switch.lookup
-; CHECK-NOT: sethi %hi(.Lswitch.table3)
-}
-
-; CHECK-NOT: .Lswitch.table
-; CHECK-NOT: .Lswitch.table1
-; CHECK-NOT: .Lswitch.table2
-; CHECK-NOT: .Lswitch.table3





More information about the llvm-commits mailing list