[PATCH] D29404: [ValueTracking] emit a warning when we detect a conflicting assumption (PR31809)
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 10:47:25 PST 2017
spatel added a comment.
In https://reviews.llvm.org/D29404#664955, @efriedma wrote:
> > 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.
Ah, I didn't think of that possibility. In that case, abandon patch?
More information about the llvm-commits