[PATCH] PlaceSafepoints: modernize gc.result.* -> gc.result

Ramkumar Ramachandra artagnon at gmail.com
Mon Feb 9 13:28:54 PST 2015


Hi reames,

http://reviews.llvm.org/D7516

Files:
  lib/Transforms/Scalar/PlaceSafepoints.cpp
  test/Transforms/Safepoint/place.ll

Index: lib/Transforms/Scalar/PlaceSafepoints.cpp
===================================================================
--- lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -945,18 +945,7 @@
     Instruction *gc_result = nullptr;
     std::vector<Type *> types;     // one per 'any' type
     types.push_back(CS.getType()); // result type
-    auto get_gc_result_id = [&](Type &Ty) {
-      if (Ty.isIntegerTy()) {
-        return Intrinsic::experimental_gc_result_int;
-      } else if (Ty.isFloatingPointTy()) {
-        return Intrinsic::experimental_gc_result_float;
-      } else if (Ty.isPointerTy()) {
-        return Intrinsic::experimental_gc_result_ptr;
-      } else {
-        llvm_unreachable("non java type encountered");
-      }
-    };
-    Intrinsic::ID Id = get_gc_result_id(*CS.getType());
+    Intrinsic::ID Id = Intrinsic::experimental_gc_result;
     Value *gc_result_func = Intrinsic::getDeclaration(M, Id, types);
 
     std::vector<Value *> args;
Index: test/Transforms/Safepoint/place.ll
===================================================================
--- test/Transforms/Safepoint/place.ll
+++ test/Transforms/Safepoint/place.ll
@@ -13,7 +13,7 @@
 ; inserted for a function that doesn't take arguments.
 ; CHECK: gc.statepoint.p0f_isVoidf
 ; CHECK: gc.statepoint.p0f_i1f
-; CHECK: gc.result.int.i1
+; CHECK: gc.result.i1
 entry:
   %call1 = tail call i1 ()* @void_return_i1()
   ret i1 %call1
@@ -26,8 +26,8 @@
 ; CHECK: gc.statepoint.p0f_isVoidf
 ; CHECK: gc.statepoint.p0f_i1i1f
 ; CHECK: (i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0)
-; CHECK: gc.result.int.i1
+; CHECK: gc.result.i1
 entry:
   %call1 = tail call i1 (i1)* @i1_return_i1(i1 false)
   ret i1 %call1
 }
\ No newline at end of file

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7516.19608.patch
Type: text/x-patch
Size: 1779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150209/55e9b040/attachment.bin>


More information about the llvm-commits mailing list