Stream: general

Topic: freeze in LLVM!


RalfJ (Nov 06 2019 at 15:36, on Zulip):

@rkruppe @gnzlbg wow, it finally happened :D
https://github.com/llvm/llvm-project/blob/master/llvm/docs/LangRef.rst#L10202

rkruppe (Nov 06 2019 at 15:42, on Zulip):

Yeah, it's nice isn't it? :3 Let's hope undef dies soon, too.

Lokathor (Nov 07 2019 at 17:54, on Zulip):

Where's the RFC for a freeze intrinsic? ;P

rkruppe (Nov 07 2019 at 20:50, on Zulip):

In Rust? That's a different can of worms because LLVM's freeze operates on a single SSA value while Rust types are generally not mapped to SSA values.

gnzlbg (Nov 08 2019 at 11:26, on Zulip):

@aqjune was this you? :D

gnzlbg (Nov 08 2019 at 11:27, on Zulip):

The docs do not mention that the freeze intrinsic might write to the memory

gnzlbg (Nov 08 2019 at 11:27, on Zulip):

and it is unclear whether doing that might be a data-race

gnzlbg (Nov 08 2019 at 11:27, on Zulip):

(how does it synchronize?)

rkruppe (Nov 08 2019 at 11:42, on Zulip):

Different freeze! This thread is about the instruction that freezes a single SSA value, not a range of memory. You're thinking of the intrinsic discussed in https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Intrinsic.20for.20freezing.20bytes which hasn't landed yet.

gnzlbg (Nov 08 2019 at 13:48, on Zulip):

Ah!

gnzlbg (Nov 08 2019 at 13:49, on Zulip):

So this looks useful as in of itself.

aqjune (Nov 08 2019 at 16:18, on Zulip):

@gnzlbg Hi, yes. :)
Replacing undef with poison is the next target. I guess this might need another time frame, but I believe people will finally like it as well.
The freeze intrinsic for memory is still effective as @rkruppe said . But its semantics is not crystal clear yet, and after discussion with people (including @RalfJ) I became to think that it will be informative to implement freeze intrinsics with several different semantics and see which one generates efficient code with existing LLVM optimizations. It may take some time, but having such data will be helpful for the design choice.

Last update: Nov 20 2019 at 13:05UTC