Stream: t-compiler

Topic: nounwind intrinsics?


RalfJ (Jul 18 2019 at 23:25, on Zulip):

@eddyb I just saw https://github.com/rust-lang/rust/blob/2eb0bc5e3c52a34b6d62ab0527520c66e4c575bd/src/librustc_codegen_llvm/attributes.rs#L282-L286. Doesn't that code make intrinsics nounwind? We have an intrinsic that compiles to a panic or a NOP; panic_if_uninhabited. Is that a problem?

nagisa (Jul 18 2019 at 23:47, on Zulip):

Rust intrinsics do not end up being generated as function calls, they are generated as a sequence of instructions inline.

nagisa (Jul 18 2019 at 23:50, on Zulip):

Perhaps a better way to explain this is: you cannot ever get a function pointer to an intrinsic.

nagisa (Jul 18 2019 at 23:51, on Zulip):

The compiler will just throw a block of ice in your face.

RalfJ (Jul 19 2019 at 07:20, on Zulip):

okay. I guess I was confused because in MIR, they still are function calls (and that's how Miri sees them). But this code here in in LLVM lowering, so what you say makes sense. Thanks!

rkruppe (Jul 19 2019 at 07:35, on Zulip):

nit: a whole bunch of intrinsics do lower to LLVM level calls (of LLVM intrinsics), but I think those don't go through that code path either.

Last update: Nov 22 2019 at 05:30UTC