News for hackers. Stuff that matters.
Re:LLVM 3.9 Release Notes by yurymik on Friday September 02, 2016 @03:01PM (#12415371)
Both t0 and t1 loads are atomic, meaning you'll always get the whole object. But there's no synchronization between them and another thread can preempt the execution and change value of %ptr right after the first load.
Re:LLVM 3.9 Release Notes by euyyn on Saturday September 03, 2016 @07:59PM (#12421876)
Then the CSE optimization that removed the printf would be just plain wrong. Why create a more complicated scenario just to point that out?
Re:LLVM 3.9 Release Notes by agumonkey on Friday September 02, 2016 @06:40PM (#12416777)
and what is %ptr ? I'm having troubles googling it.
Re:LLVM 3.9 Release Notes by erichocean on Friday September 02, 2016 @07:18PM (#12416908)
I assume %ptr is a generic "variable" name[0] for a pointer reference, i.e. the address of the value being loaded atomically. You can substitute %ptr in your head for any atomic address you might want to load from.

The code itself isn't well-formed because %ptr isn't actually defined anywhere—just pretend that it was. ;)

[0] Technically, LLVM does not have variables (as in, names you can assign to more than once), since it's in SSA form, but I don't know what a better name would be here. :)

Re:LLVM 3.9 Release Notes by agumonkey on Saturday September 03, 2016 @04:51AM (#12418382)
Aight, I'll need to read their docs exhaustively, I had to anyway. Thanks nonetheless.