HomePhabricator

[LangRef] Clarify poison semantics

Authored by nikic on Jun 13 2019, 12:45 PM.

Description

[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

llvm-svn: 363320

Details

Committed
nikicJun 13 2019, 12:45 PM
Differential Revision
D63044: [LangRef] Clarify poison semantics
Parents
rG24f40858118f: [SimplifyCFG] NFC, update Switch tests as a baseline.
Branches
Unknown
Tags
Unknown