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 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 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