[PATCH] D76973: [LangRef] Clarify the semantics of branch on undef
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 28 02:42:28 PDT 2020
nikic added inline comments.
================
Comment at: llvm/docs/LangRef.rst:3457
+a not-frozen expression containing undef and it can be evaluted into different
+values.
+This explains optimizations that depend on branch conditions to construct
----------------
This definition seems unnecessary confusing, just saying "Branching on undef is undefined behavior" should be sufficient here. Undef is not frozen by definition. There's also no meaningful concept of "contains undef" in this context, as branch conditions are always scalar, so the value can only be undef or not be undef. Expressions reduce to undef or not undef in the usual ways.
================
Comment at: llvm/docs/LangRef.rst:7068
+If '``cond``' is ``poison`` or ``undef``, this instruction has undefined
+behavior.
----------------
jdoerfert wrote:
> Do we have this for switch also?
Yes, and also for `indirectbr`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76973/new/
https://reviews.llvm.org/D76973
More information about the llvm-commits
mailing list