[LLVMdev] Handling of undef in the IR

Mehdi Amini mehdi.amini at apple.com
Wed Jan 14 21:42:24 PST 2015


Hi all,

I have a very simple test case (thanks to bugpoint) that hit an assert in reassociate.
(the assert is (C->getType()->isIntOrIntVectorTy() && "Cannot NEG a nonintegral value!"), function getNeg)

The function is taking a Constant as argument, but the assert does not expect an undef. I’m not sure whose responsibility is it to handle that (caller?). 
Do we have to defensively assume that any Constant can be an undef anywhere and I should just add a check here?

Thanks,

Mehdi

PS: IR attached for reference.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug1.ll
Type: application/octet-stream
Size: 203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150114/83ad20d1/attachment.obj>


More information about the llvm-dev mailing list