[LLVMdev] LLVM Concurrency and Undef
Peter Lawrence
peterl95124 at sbcglobal.net
Sat Sep 10 19:13:24 PDT 2011
On Aug 22, 2011, at 5:29 PM, Eli Friedman wrote:
>> LLVM Atomics and Concurrency guide also states the following
>> "Note that speculative loads are allowed; a load which is part of a
>> race returns undef, but does not have undefined behavior"
>>
>> If the speculative loads returns an undef and the returned value is
>> used, then it results in an undefined behavior. Am I correct?
>
> It behaves like any other undef value... which do often lead to
> undefined behavior.
Eli,
Java by necessity has to be well defined in spite of data-
races (because, IIUC, detecting
data-races in just about anything and java-byte-codes in particular
is an N-P-complete problem,
so cannot be part of the byte-code validation process, therefore any
byte-code which does have
a data-race and does pass validation must still execute with defined
behavior).
so, again IIUC, it appears that LLVM-IR could not be used for Java if
we import C/C++'s
strict "data-race implies undefined" semantics into our IR.
sincerely,
Peter Lawrence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110910/6b98b621/attachment.html>
More information about the llvm-dev
mailing list