[PATCH] [GC] improve testing around gc.relocate and catch a bug

Sanjoy Das sanjoy at playingwithpointers.com
Fri Jan 2 11:51:42 PST 2015


Some small nits inline.  I'll defer to Philip for an LGTM.


================
Comment at: lib/IR/Verifier.cpp:2695
@@ -2695,1 +2694,3 @@
+    const Function *StatepointFn =
+      StatepointCS.getInstruction() ? StatepointCS.getCalledFunction() : NULL;
     Assert2(StatepointFn && StatepointFn->isDeclaration() &&
----------------
Should be `nullptr`

================
Comment at: lib/IR/Verifier.cpp:2734
@@ -2728,2 +2733,3 @@
     Assert1(0 <= BaseIndex &&
             BaseIndex < (int)StatepointCS.arg_size(),
+            "gc.relocate: statepoint base index out of bounds", &CI);
----------------
Might be cleaner to store the result of `getZExtValue()` in an `unsigned` instead.

================
Comment at: test/CodeGen/X86/statepoint-stackmap-format.ll:30
@@ -30,2 +29,3 @@
+  %b = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 7, i32 7)
 ; 
   ret i1 %call1
----------------
You had to make these changes because the original indices are out of range, right?

http://reviews.llvm.org/D6824

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






More information about the llvm-commits mailing list