diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-13 19:45:36 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-13 19:45:36 +0000 |
commit | ad81d427caaf71f096f85c19a6e3cea749b24051 (patch) | |
tree | dbd4816a60dafcabda50e315be34f5dc51fc3788 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 24f40858118f303e7ec85692a18771a8140b678c (diff) | |
download | bcm5719-llvm-ad81d427caaf71f096f85c19a6e3cea749b24051.tar.gz bcm5719-llvm-ad81d427caaf71f096f85c19a6e3cea749b24051.zip |
[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
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index bfea8fc3c50..e49f28513b8 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4336,6 +4336,8 @@ bool llvm::isGuaranteedToExecuteForEveryIteration(const Instruction *I, } bool llvm::propagatesFullPoison(const Instruction *I) { + // TODO: This should include all instructions apart from phis, selects and + // call-like instructions. switch (I->getOpcode()) { case Instruction::Add: case Instruction::Sub: |