Skip to content

Commit a412fe1

Browse files
committed
Pass the acutal intrinsic llfn type when overriding libm functions.
Previous change was just to get the backend to compile. This gets libm to compile now.
1 parent f5614e1 commit a412fe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/rustc_codegen_nvvm/src/override_fns.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ fn is_unsupported_libdevice_fn(name: &str) -> bool {
5151
fn override_libm_function<'ll, 'tcx>(func: Instance<'tcx>, cx: &CodegenCx<'ll, 'tcx>) {
5252
let name = cx.tcx.item_name(func.def_id());
5353
let nv_name = format!("__nv_{}", name.as_str());
54-
let intrinsic = cx.get_intrinsic(nv_name.as_str());
54+
let (intrinsic_llfn_ty, intrinsic_llfn) = cx.get_intrinsic(nv_name.as_str());
5555

5656
let llfn = cx.get_fn(func);
5757
let start = Builder::append_block(cx, llfn, "start");
5858
let mut bx = Builder::build(cx, start);
5959

6060
let params = llvm::get_params(llfn);
61-
let llcall = bx.call(cx.type_i1(), None, None, intrinsic.1, &params, None, None);
61+
let llcall = bx.call(intrinsic_llfn_ty, None, None, intrinsic_llfn, &params, None, None);
6262
bx.ret(llcall);
6363
}

0 commit comments

Comments
 (0)