[PATCH] D29404: [ValueTracking] emit a warning when we detect a conflicting assumption (PR31809)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 10:42:35 PST 2017


efriedma added a comment.

> When we hit this case, we're headed for disaster: either we have a bug in LLVM or the program has UB.

"the program has UB" is a bit ambiguous.  It's possible the "llvm.assume" call is dynamically unreachable, and therefore the undefined behavior doesn't matter.  The dynamically unreachable codepath might not even exist in the original source code; for example, loop unswitching could duplicate a loop, and then one of "llvm.assume" calls becomes unreachable due to a correlated condition.  This is one of the reasons LLVM doesn't emit warnings when the optimizer discovers code with undefined behavior.


https://reviews.llvm.org/D29404





More information about the llvm-commits mailing list