OSDN Git Service

[LangRef] Clarify poison semantics
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 13 Jun 2019 19:45:36 +0000 (19:45 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 13 Jun 2019 19:45:36 +0000 (19:45 +0000)
commit2528c30938fb501c7937ba37cb39a2b35689b719
tree8c3535c9bf37ed77efeadaeaca05c84125f7cb8e
parent2305c8a70bdffcadb57659cf17482d7a015fff2e
[LangRef] Clarify poison semantics

I find the current documentation of poison somewhat confusing,
mainly because its use of "undefined behavior" doesn't seem to
align with our usual interpretation (of immediate UB). Especially
the sentence "any instruction that has a dependence on a poison
value has undefined behavior" is very confusing.

Clarify poison semantics by:

 * Replacing the introductory paragraph with the standard rationale
   for having poison values.
 * Spelling out that instructions depending on poison return poison.
 * Spelling out how we go from a poison value to immediate undefined
   behavior and give the two examples we currently use in ValueTracking.
 * Spelling out that side effects depending on poison are UB.

Differential Revision: https://reviews.llvm.org/D63044

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363320 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst
lib/Analysis/ValueTracking.cpp