llvm.org GIT mirror llvm / 150fff8
[Tests] Split an LFTR dead-iv case There are two interesting sub-cases here. 1) Switching IVs is legal, but only in pre-increment form. and 2) Switching IVs is legal, and so is post-increment form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362993 91177308-0d34-0410-b5e6-96231b3b80d8 Philip Reames 4 months ago
1 changed file(s) with 33 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
101101 ret void
102102 }
103103
104 define void @dom_store(i8* %a) #0 {
105 ; CHECK-LABEL: @dom_store(
104 define void @dom_store_preinc(i8* %a) #0 {
105 ; CHECK-LABEL: @dom_store_preinc(
106 ; CHECK-NEXT: entry:
107 ; CHECK-NEXT: br label [[LOOP:%.*]]
108 ; CHECK: loop:
109 ; CHECK-NEXT: [[I_0:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[TMP4:%.*]], [[LOOP]] ]
110 ; CHECK-NEXT: [[P_0:%.*]] = phi i8* [ [[A:%.*]], [[ENTRY]] ], [ [[TMP3:%.*]], [[LOOP]] ]
111 ; CHECK-NEXT: store volatile i8 0, i8* [[P_0]]
112 ; CHECK-NEXT: [[TMP3]] = getelementptr inbounds i8, i8* [[P_0]], i64 1
113 ; CHECK-NEXT: [[TMP4]] = add nuw i8 [[I_0]], 1
114 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i8 [[TMP4]], -10
115 ; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOP]], label [[EXIT:%.*]]
116 ; CHECK: exit:
117 ; CHECK-NEXT: ret void
118 ;
119 entry:
120 br label %loop
121
122 loop:
123 %i.0 = phi i8 [ 0, %entry ], [ %tmp4, %loop ]
124 %p.0 = phi i8* [ %a, %entry ], [ %tmp3, %loop ]
125 store volatile i8 0, i8* %p.0
126 %tmp3 = getelementptr inbounds i8, i8* %p.0, i64 1
127 %tmp4 = add i8 %i.0, 1
128 %tmp5 = icmp ult i8 %tmp4, -10
129 br i1 %tmp5, label %loop, label %exit
130
131 exit:
132 ret void
133 }
134
135 define void @dom_store_postinc(i8* %a) #0 {
136 ; CHECK-LABEL: @dom_store_postinc(
106137 ; CHECK-NEXT: entry:
107138 ; CHECK-NEXT: br label [[LOOP:%.*]]
108139 ; CHECK: loop: