llvm.org GIT mirror llvm / 3aa4a35
Merging r279268: ------------------------------------------------------------------------ r279268 | majnemer | 2016-08-19 09:37:40 -0700 (Fri, 19 Aug 2016) | 5 lines [CloneFunction] Don't remove unrelated nodes from the CGSSC CGSCC use a WeakVH to track call sites. RAUW a call within a function can result in that WeakVH getting confused about whether or not the call site is still around. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@279477 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 4 years ago
2 changed file(s) with 30 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
565565 if (!I)
566566 continue;
567567
568 // Skip over non-intrinsic callsites, we don't want to remove any nodes from
569 // the CGSCC.
570 CallSite CS = CallSite(I);
571 if (CS && CS.getCalledFunction() && !CS.getCalledFunction()->isIntrinsic())
572 continue;
573
568574 // See if this instruction simplifies.
569575 Value *SimpleV = SimplifyInstruction(I, DL);
570576 if (!SimpleV)
298298 }
299299
300300 ; CHECK-LABEL: define i32 @PR28802(
301 ; CHECK: call i32 @PR28802.external(i32 0)
302 ; CHECK: ret i32 0
301 ; CHECK: %[[call:.*]] = call i32 @PR28802.external(i32 0)
302 ; CHECK: ret i32 %[[call]]
303303
304304 define internal i32 @PR28848.callee(i32 %p2, i1 %c) {
305305 entry:
321321 }
322322 ; CHECK-LABEL: define i32 @PR28848(
323323 ; CHECK: ret i32 0
324
325 define internal void @callee7(i16 %param1, i16 %param2) {
326 entry:
327 br label %bb
328
329 bb:
330 %phi = phi i16 [ %param2, %entry ]
331 %add = add i16 %phi, %param1
332 ret void
333 }
334
335 declare i16 @caller7.external(i16 returned)
336
337 define void @caller7() {
338 bb1:
339 %call = call i16 @caller7.external(i16 1)
340 call void @callee7(i16 0, i16 %call)
341 ret void
342 }
343 ; CHECK-LABEL: define void @caller7(
344 ; CHECK: %call = call i16 @caller7.external(i16 1)
345 ; CHECK-NEXT: ret void