[llvm-branch-commits] [llvm-branch] r279477 - Merging r279268:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 22 14:23:56 PDT 2016


Author: hans
Date: Mon Aug 22 16:23:55 2016
New Revision: 279477

URL: http://llvm.org/viewvc/llvm-project?rev=279477&view=rev
Log:
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.
------------------------------------------------------------------------

Modified:
    llvm/branches/release_39/   (props changed)
    llvm/branches/release_39/lib/Transforms/Utils/CloneFunction.cpp
    llvm/branches/release_39/test/Transforms/Inline/inline_constprop.ll

Propchange: llvm/branches/release_39/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 22 16:23:55 2016
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,275868-275870,275879,275898,275928,275935,275946,275978,275981,276015,276051,276077,276109,276119,276181,276209,276236-276237,276358,276364,276368,276389,276435,276438,276479,276510,276648,276676,276712,276740,276823,276956,276980,277093,277114,277135,277371,277399,277500,277504,277625,277691,277693,277773,278002,278086,278133,278157,278343,278370,278413,278558-278559,278562,278569,278571,278573,278575,278584,278841,278900,278938,278999,279125,279369
+/llvm/trunk:155241,275868-275870,275879,275898,275928,275935,275946,275978,275981,276015,276051,276077,276109,276119,276181,276209,276236-276237,276358,276364,276368,276389,276435,276438,276479,276510,276648,276676,276712,276740,276823,276956,276980,277093,277114,277135,277371,277399,277500,277504,277625,277691,277693,277773,278002,278086,278133,278157,278343,278370,278413,278558-278559,278562,278569,278571,278573,278575,278584,278841,278900,278938,278999,279125,279268,279369

Modified: llvm/branches/release_39/lib/Transforms/Utils/CloneFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/lib/Transforms/Utils/CloneFunction.cpp?rev=279477&r1=279476&r2=279477&view=diff
==============================================================================
--- llvm/branches/release_39/lib/Transforms/Utils/CloneFunction.cpp (original)
+++ llvm/branches/release_39/lib/Transforms/Utils/CloneFunction.cpp Mon Aug 22 16:23:55 2016
@@ -566,6 +566,12 @@ void llvm::CloneAndPruneIntoFromInst(Fun
     if (!I)
       continue;
 
+    // Skip over non-intrinsic callsites, we don't want to remove any nodes from
+    // the CGSCC.
+    CallSite CS = CallSite(I);
+    if (CS && CS.getCalledFunction() && !CS.getCalledFunction()->isIntrinsic())
+      continue;
+
     // See if this instruction simplifies.
     Value *SimpleV = SimplifyInstruction(I, DL);
     if (!SimpleV)

Modified: llvm/branches/release_39/test/Transforms/Inline/inline_constprop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_39/test/Transforms/Inline/inline_constprop.ll?rev=279477&r1=279476&r2=279477&view=diff
==============================================================================
--- llvm/branches/release_39/test/Transforms/Inline/inline_constprop.ll (original)
+++ llvm/branches/release_39/test/Transforms/Inline/inline_constprop.ll Mon Aug 22 16:23:55 2016
@@ -299,8 +299,8 @@ entry:
 }
 
 ; CHECK-LABEL: define i32 @PR28802(
-; CHECK: call i32 @PR28802.external(i32 0)
-; CHECK: ret i32 0
+; CHECK: %[[call:.*]] = call i32 @PR28802.external(i32 0)
+; CHECK: ret i32 %[[call]]
 
 define internal i32 @PR28848.callee(i32 %p2, i1 %c) {
 entry:
@@ -322,3 +322,25 @@ entry:
 }
 ; CHECK-LABEL: define i32 @PR28848(
 ; CHECK: ret i32 0
+
+define internal void @callee7(i16 %param1, i16 %param2) {
+entry:
+  br label %bb
+
+bb:
+  %phi = phi i16 [ %param2, %entry ]
+  %add = add i16 %phi, %param1
+  ret void
+}
+
+declare i16 @caller7.external(i16 returned)
+
+define void @caller7() {
+bb1:
+  %call = call i16 @caller7.external(i16 1)
+  call void @callee7(i16 0, i16 %call)
+  ret void
+}
+; CHECK-LABEL: define void @caller7(
+; CHECK: %call = call i16 @caller7.external(i16 1)
+; CHECK-NEXT: ret void




More information about the llvm-branch-commits mailing list