[PATCH] [RewriteStatepointsForGC] Exclude noreturn calls from doing GC liveness analysis

Philip Reames listmail at philipreames.com
Tue May 19 16:50:49 PDT 2015


================
Comment at: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:1009
@@ +1008,3 @@
+// analysis for it.
+static bool isNoReturnCall(const CallSite &CS) {
+  // Be conservative on invokes
----------------
I'd rename this slightly.  NoReturn is a well defined concept.  Given the invoke case, this is more like doesntNeedLivePointers or something.

================
Comment at: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:1035
@@ -1021,2 +1034,3 @@
     const CallSite &CS = toUpdate[i];
-    recomputeLiveInValues(RevisedLivenessData, CS, info);
+    if (!isNoReturnCall(CS)) {
+      recomputeLiveInValues(RevisedLivenessData, CS, info);
----------------
I'd be tempted to move this check inside the liveness analysis since you're still returning the correct result, just differently.

Also, what are you actually saving in compute time here?  Isn't walking back from the end of the block just as fast?

================
Comment at: test/Transforms/RewriteStatepointsForGC/noreturn-calls.ll:6
@@ +5,3 @@
+
+; CHECK-NOT: Live Variables:
+
----------------
Please don't check for this debug output.  Checking that there are no gc.relocates would be more appropriate.  

================
Comment at: test/Transforms/RewriteStatepointsForGC/noreturn-calls.ll:20
@@ +19,3 @@
+; effectively noreturn call because it's unreachable after call
+  %safepoint_token0 = tail call i32 (i64, i32, void (%jObject addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidp1jObjectf(i64 0, i32 0, void (%jObject addrspace(1)*)* @some_call, i32 1, i32 0, %jObject addrspace(1)* %arg, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0) 
+  unreachable
----------------
Please trim unneeded deopt args.

http://reviews.llvm.org/D9860

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list