llvm.org GIT mirror llvm / 0cdf5ee
Merging r281650: ------------------------------------------------------------------------ r281650 | david.majnemer | 2016-09-15 13:10:09 -0700 (Thu, 15 Sep 2016) | 6 lines [InstCombine] Do not RAUW a constant GEP canRewriteGEPAsOffset expects to process instructions, not constants. This fixes PR30342. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288066 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
2 changed file(s) with 21 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
633633 }
634634
635635 if (!isa(V) && !isa(V) &&
636 !isaEPOperator>(V) && !isa(V))
636 !isaetElementPtrInst>(V) && !isa(V))
637637 // We've found some value that we can't explore which is different from
638638 // the base. Therefore we can't do this transformation.
639639 return false;
166166 ; CHECK: ret i32* %[[PTR]]
167167 }
168168
169
170 @pr30402 = constant i64 3
171 define i1 @test7() {
172 entry:
173 br label %bb7
174
175 bb7: ; preds = %bb10, %entry-block
176 %phi = phi i64* [ @pr30402, %entry ], [ getelementptr inbounds (i64, i64* @pr30402, i32 1), %bb7 ]
177 %cmp = icmp eq i64* %phi, getelementptr inbounds (i64, i64* @pr30402, i32 1)
178 br i1 %cmp, label %bb10, label %bb7
179
180 bb10:
181 ret i1 %cmp
182 }
183 ; CHECK-LABEL: @test7(
184 ; CHECK: %[[phi:.*]] = phi i64* [ @pr30402, %entry ], [ getelementptr inbounds (i64, i64* @pr30402, i32 1), %bb7 ]
185 ; CHECK: %[[cmp:.*]] = icmp eq i64* %[[phi]], getelementptr inbounds (i64, i64* @pr30402, i32 1)
186 ; CHECK: ret i1 %[[cmp]]
187
188
169189 declare i32 @__gxx_personality_v0(...)