diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:52:33 +0000 |
| commit | 009b1c42aa6266385f2c37e227516b24077e6dd7 (patch) | |
| tree | 64ba909838c23261cace781ece27d106134ea451 /test/Transforms/LoopRotate | |
Notes
Diffstat (limited to 'test/Transforms/LoopRotate')
| -rw-r--r-- | test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll | 21 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/LRCrash-1.ll | 18 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/LRCrash-2.ll | 24 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/LRCrash-3.ll | 29 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/LRCrash-4.ll | 18 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/LRCrash-5.ll | 26 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/PhiRename-1.ll | 95 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/PhiSelfRefernce-1.ll | 39 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/dg.exp | 3 | ||||
| -rw-r--r-- | test/Transforms/LoopRotate/pr2639.ll | 38 |
10 files changed, 311 insertions, 0 deletions
diff --git a/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll b/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll new file mode 100644 index 000000000000..7cc3951b3cd1 --- /dev/null +++ b/test/Transforms/LoopRotate/2009-01-25-SingleEntryPhi.ll @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis +; PR3408 +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-unknown-linux-gnu" + %struct.Cls = type { i32, i8, [2 x %struct.Cls*], [2 x %struct.Lit*] } + %struct.Lit = type { i8 } + +define void @picosat_main_bb13.i.i71.outer_bb132.i.i.i.outer(%struct.Cls**, %struct.Cls**, i32 %collect.i.i.i.1.lcssa, i32 %lcollect.i.i.i.2.lcssa, %struct.Cls*** %rhead.tmp.0236.out, i32* %collect.i.i.i.2.out, i32* %lcollect.i.i.i.3.ph.ph.ph.out) nounwind { +newFuncRoot: + br label %codeRepl + +bb133.i.i.i.exitStub: ; preds = %codeRepl + ret void + +bb130.i.i.i: ; preds = %codeRepl + %rhead.tmp.0236.lcssa82 = phi %struct.Cls** [ null, %codeRepl ] ; <%struct.Cls**> [#uses=0] + br label %codeRepl + +codeRepl: ; preds = %bb130.i.i.i, %newFuncRoot + br i1 false, label %bb130.i.i.i, label %bb133.i.i.i.exitStub +} diff --git a/test/Transforms/LoopRotate/LRCrash-1.ll b/test/Transforms/LoopRotate/LRCrash-1.ll new file mode 100644 index 000000000000..e6c7667d5975 --- /dev/null +++ b/test/Transforms/LoopRotate/LRCrash-1.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output + + %struct.relation = type { [4 x i16], i32, [4 x i16], i32, i32 } + +define void @findAllPairs() { +entry: + br i1 false, label %bb139, label %bb10.i44 +bb10.i44: ; preds = %entry + ret void +bb127: ; preds = %bb139 + br label %bb139 +bb139: ; preds = %bb127, %entry + br i1 false, label %bb127, label %bb142 +bb142: ; preds = %bb139 + %r91.0.lcssa = phi %struct.relation* [ null, %bb139 ] ; <%struct.relation*> [#uses=0] + ret void +} + diff --git a/test/Transforms/LoopRotate/LRCrash-2.ll b/test/Transforms/LoopRotate/LRCrash-2.ll new file mode 100644 index 000000000000..6dbe76df9eb3 --- /dev/null +++ b/test/Transforms/LoopRotate/LRCrash-2.ll @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output + +define void @findAllPairs() { +entry: + br i1 false, label %bb139, label %cond_true +cond_true: ; preds = %entry + ret void +bb90: ; preds = %bb139 + br i1 false, label %bb136, label %cond_next121 +cond_next121: ; preds = %bb90 + br i1 false, label %bb136, label %bb127 +bb127: ; preds = %cond_next121 + br label %bb136 +bb136: ; preds = %bb127, %cond_next121, %bb90 + %changes.1 = phi i32 [ %changes.2, %bb90 ], [ %changes.2, %cond_next121 ], [ 1, %bb127 ] ; <i32> [#uses=1] + br label %bb139 +bb139: ; preds = %bb136, %entry + %changes.2 = phi i32 [ %changes.1, %bb136 ], [ 0, %entry ] ; <i32> [#uses=3] + br i1 false, label %bb90, label %bb142 +bb142: ; preds = %bb139 + %changes.2.lcssa = phi i32 [ %changes.2, %bb139 ] ; <i32> [#uses=0] + ret void +} + diff --git a/test/Transforms/LoopRotate/LRCrash-3.ll b/test/Transforms/LoopRotate/LRCrash-3.ll new file mode 100644 index 000000000000..94991a55b824 --- /dev/null +++ b/test/Transforms/LoopRotate/LRCrash-3.ll @@ -0,0 +1,29 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output + +define void @_ZN9Classfile4readEv() { +entry: + br i1 false, label %cond_false485, label %bb405 +bb405: ; preds = %entry + ret void +cond_false485: ; preds = %entry + br label %bb830 +bb511: ; preds = %bb830 + br i1 false, label %bb816, label %bb830 +cond_next667: ; preds = %bb816 + br i1 false, label %cond_next695, label %bb680 +bb676: ; preds = %bb680 + br label %bb680 +bb680: ; preds = %bb676, %cond_next667 + %iftmp.68.0 = zext i1 false to i8 ; <i8> [#uses=1] + br i1 false, label %bb676, label %cond_next695 +cond_next695: ; preds = %bb680, %cond_next667 + %iftmp.68.2 = phi i8 [ %iftmp.68.0, %bb680 ], [ undef, %cond_next667 ] ; <i8> [#uses=0] + ret void +bb816: ; preds = %bb816, %bb511 + br i1 false, label %cond_next667, label %bb816 +bb830: ; preds = %bb511, %cond_false485 + br i1 false, label %bb511, label %bb835 +bb835: ; preds = %bb830 + ret void +} + diff --git a/test/Transforms/LoopRotate/LRCrash-4.ll b/test/Transforms/LoopRotate/LRCrash-4.ll new file mode 100644 index 000000000000..ab43fc88922c --- /dev/null +++ b/test/Transforms/LoopRotate/LRCrash-4.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output + +define void @InterpretSEIMessage(i8* %msg) { +entry: + br label %bb15 +bb6: ; preds = %bb15 + %gep.upgrd.1 = zext i32 %offset.1 to i64 ; <i64> [#uses=1] + %tmp11 = getelementptr i8* %msg, i64 %gep.upgrd.1 ; <i8*> [#uses=0] + br label %bb15 +bb15: ; preds = %bb6, %entry + %offset.1 = add i32 0, 1 ; <i32> [#uses=2] + br i1 false, label %bb6, label %bb17 +bb17: ; preds = %bb15 + %offset.1.lcssa = phi i32 [ %offset.1, %bb15 ] ; <i32> [#uses=0] + %payload_type.1.lcssa = phi i32 [ 0, %bb15 ] ; <i32> [#uses=0] + ret void +} + diff --git a/test/Transforms/LoopRotate/LRCrash-5.ll b/test/Transforms/LoopRotate/LRCrash-5.ll new file mode 100644 index 000000000000..d61e749d7ee4 --- /dev/null +++ b/test/Transforms/LoopRotate/LRCrash-5.ll @@ -0,0 +1,26 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output +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" + %struct.NSArray = type { %struct.NSObject } + %struct.NSObject = type { %struct.objc_class* } + %struct.NSRange = type { i64, i64 } + %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* } + %struct.objc_class = type opaque + %struct.objc_selector = type opaque +@"\01L_OBJC_MESSAGE_REF_26" = external global %struct._message_ref_t ; <%struct._message_ref_t*> [#uses=1] + +define %struct.NSArray* @"-[NSString(DocSetPrivateAddition) _dsa_stringAsPathComponent]"(%struct.NSArray* %self, %struct._message_ref_t* %_cmd) { +entry: + br label %bb116 + +bb116: ; preds = %bb131, %entry + %tmp123 = call %struct.NSRange null( %struct.NSObject* null, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_26", %struct.NSArray* null ) ; <%struct.NSRange> [#uses=1] + br i1 false, label %bb141, label %bb131 + +bb131: ; preds = %bb116 + %mrv_gr125 = getresult %struct.NSRange %tmp123, 1 ; <i64> [#uses=0] + br label %bb116 + +bb141: ; preds = %bb116 + ret %struct.NSArray* null +} diff --git a/test/Transforms/LoopRotate/PhiRename-1.ll b/test/Transforms/LoopRotate/PhiRename-1.ll new file mode 100644 index 000000000000..573e3960bd86 --- /dev/null +++ b/test/Transforms/LoopRotate/PhiRename-1.ll @@ -0,0 +1,95 @@ +; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep {\\\[ .tmp224} +; END. +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" + + %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.Index_Map = type { i32, %struct.item_set** } + %struct.Item = type { [4 x i16], %struct.rule* } + %struct.__sFILEX = type opaque + %struct.__sbuf = type { i8*, i32 } + %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* } + %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* } + %struct.list = type { i8*, %struct.list* } + %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** } + %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* } + %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* } + %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] } + %struct.plank = type { i8*, %struct.list*, i32 } + %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* } + %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 } + %struct.stateMap = type { i8*, %struct.plank*, i32, i16* } + %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** } +@outfile = external global %struct.FILE* ; <%struct.FILE**> [#uses=1] +@str1 = external constant [11 x i8] ; <[11 x i8]*> [#uses=1] +@operators = weak global %struct.list* null ; <%struct.list**> [#uses=1] + + + +define i32 @opsOfArity(i32 %arity) { +entry: + %arity_addr = alloca i32 ; <i32*> [#uses=2] + %retval = alloca i32, align 4 ; <i32*> [#uses=2] + %tmp = alloca i32, align 4 ; <i32*> [#uses=2] + %c = alloca i32, align 4 ; <i32*> [#uses=4] + %l = alloca %struct.list*, align 4 ; <%struct.list**> [#uses=5] + %op = alloca %struct.operator*, align 4 ; <%struct.operator**> [#uses=3] + "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] + store i32 %arity, i32* %arity_addr + store i32 0, i32* %c + %tmp1 = load %struct.list** @operators ; <%struct.list*> [#uses=1] + store %struct.list* %tmp1, %struct.list** %l + br label %bb21 + +bb: ; preds = %bb21 + %tmp3 = getelementptr %struct.list* %tmp22, i32 0, i32 0 ; <i8**> [#uses=1] + %tmp4 = load i8** %tmp3 ; <i8*> [#uses=1] + %tmp45 = bitcast i8* %tmp4 to %struct.operator* ; <%struct.operator*> [#uses=1] + store %struct.operator* %tmp45, %struct.operator** %op + %tmp6 = load %struct.operator** %op ; <%struct.operator*> [#uses=1] + %tmp7 = getelementptr %struct.operator* %tmp6, i32 0, i32 5 ; <i32*> [#uses=1] + %tmp8 = load i32* %tmp7 ; <i32> [#uses=1] + %tmp9 = load i32* %arity_addr ; <i32> [#uses=1] + icmp eq i32 %tmp8, %tmp9 ; <i1>:0 [#uses=1] + zext i1 %0 to i8 ; <i8>:1 [#uses=1] + icmp ne i8 %1, 0 ; <i1>:2 [#uses=1] + br i1 %2, label %cond_true, label %cond_next + +cond_true: ; preds = %bb + %tmp10 = load %struct.operator** %op ; <%struct.operator*> [#uses=1] + %tmp11 = getelementptr %struct.operator* %tmp10, i32 0, i32 2 ; <i32*> [#uses=1] + %tmp12 = load i32* %tmp11 ; <i32> [#uses=1] + %tmp13 = load %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1] + %tmp14 = getelementptr [11 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp15 = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; <i32> [#uses=0] + %tmp16 = load i32* %c ; <i32> [#uses=1] + %tmp17 = add i32 %tmp16, 1 ; <i32> [#uses=1] + store i32 %tmp17, i32* %c + br label %cond_next + +cond_next: ; preds = %cond_true, %bb + %tmp19 = getelementptr %struct.list* %tmp22, i32 0, i32 1 ; <%struct.list**> [#uses=1] + %tmp20 = load %struct.list** %tmp19 ; <%struct.list*> [#uses=1] + store %struct.list* %tmp20, %struct.list** %l + br label %bb21 + +bb21: ; preds = %cond_next, %entry + %l.in = phi %struct.list** [ @operators, %entry ], [ %tmp19, %cond_next ] ; + %tmp22 = load %struct.list** %l.in ; <%struct.list*> [#uses=1] + icmp ne %struct.list* %tmp22, null ; <i1>:3 [#uses=1] + zext i1 %3 to i8 ; <i8>:4 [#uses=1] + icmp ne i8 %4, 0 ; <i1>:5 [#uses=1] + br i1 %5, label %bb, label %bb23 + +bb23: ; preds = %bb21 + %tmp24 = load i32* %c ; <i32> [#uses=1] + store i32 %tmp24, i32* %tmp + %tmp25 = load i32* %tmp ; <i32> [#uses=1] + store i32 %tmp25, i32* %retval + br label %return + +return: ; preds = %bb23 + %retval26 = load i32* %retval ; <i32> [#uses=1] + ret i32 %retval26 +} + +declare i32 @fprintf(%struct.FILE*, i8*, ...) diff --git a/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll b/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll new file mode 100644 index 000000000000..a55704b1fdb6 --- /dev/null +++ b/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll @@ -0,0 +1,39 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output +; ModuleID = 'PhiSelfRefernce-1.bc' + +define void @snrm2(i32 %incx) { +entry: + br i1 false, label %START, label %return + +START: ; preds = %entry + br i1 false, label %bb85, label %cond_false93 + +bb52: ; preds = %bb85 + br i1 false, label %bb307, label %cond_next71 + +cond_next71: ; preds = %bb52 + ret void + +bb85: ; preds = %START + br i1 false, label %bb52, label %bb88 + +bb88: ; preds = %bb85 + ret void + +cond_false93: ; preds = %START + ret void + +bb243: ; preds = %bb307 + br label %bb307 + +bb307: ; preds = %bb243, %bb52 + %sx_addr.2.pn = phi float* [ %sx_addr.5, %bb243 ], [ null, %bb52 ] ; <float*> [#uses=1] + %sx_addr.5 = getelementptr float* %sx_addr.2.pn, i32 %incx ; <float*> [#uses=1] + br i1 false, label %bb243, label %bb310 + +bb310: ; preds = %bb307 + ret void + +return: ; preds = %entry + ret void +} diff --git a/test/Transforms/LoopRotate/dg.exp b/test/Transforms/LoopRotate/dg.exp new file mode 100644 index 000000000000..f2005891a59a --- /dev/null +++ b/test/Transforms/LoopRotate/dg.exp @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] diff --git a/test/Transforms/LoopRotate/pr2639.ll b/test/Transforms/LoopRotate/pr2639.ll new file mode 100644 index 000000000000..67477ade9968 --- /dev/null +++ b/test/Transforms/LoopRotate/pr2639.ll @@ -0,0 +1,38 @@ +; RUN: llvm-as < %s | opt -loop-deletion -loop-rotate -disable-output +; PR 2639 + + %struct.HexxagonMove = type { i8, i8, i32 } + +define void @_ZN16HexxagonMoveList7addMoveER12HexxagonMove() { +entry: + br i1 false, label %bb9.preheader, label %bb11 + +bb9.preheader: ; preds = %entry + br label %bb9 + +bb1: ; preds = %bb9 + br i1 false, label %bb3, label %bb8 + +bb3: ; preds = %bb1 + br label %bb5 + +bb4: ; preds = %bb5 + br label %bb5 + +bb5: ; preds = %bb4, %bb3 + %exitcond = icmp eq i32 0, 0 ; <i1> [#uses=1] + br i1 %exitcond, label %bb7, label %bb4 + +bb7: ; preds = %bb5 + store %struct.HexxagonMove* null, %struct.HexxagonMove** null, align 4 + br label %bb8 + +bb8: ; preds = %bb7, %bb1 + br label %bb9 + +bb9: ; preds = %bb8, %bb9.preheader + br i1 false, label %bb11, label %bb1 + +bb11: ; preds = %bb9, %entry + ret void +} |
