[LLVMdev] SCCP and undef branches
Chris Lattner
sabre at nondot.org
Wed Jun 7 14:52:34 PDT 2006
On Wed, 7 Jun 2006, Domagoj Babic wrote:
> Here's something I don't understand... How come that UNDEF can
> appear as a branch condition at all? I just can't think of any ways.
Lots of different ways, e.g.:
fun() {
_Bool C;
if (C) { ... }
}
> Second, if it already can appear, isn't that a bug that should be
> reported by the compiler?
That's up to the front-end. If you turn on enough warnings you should get
one.
At the compiler level, they can occur due to unrealizable code paths (not
necessarily bugs in the user code), so it's useful for the optimizer to
take advantage of it.
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list