[LLVMdev] i1 Values
dag at cray.com
dag at cray.com
Thu Feb 5 12:48:41 PST 2015
I've been debugging some strange happenings over here and I put an
assert in APInt to catch what I think is the source of the problem:
int64_t getSExtValue() const {
// An i1 -1 is unrepresentable.
assert(BitWidth != 1 && "Signed i1 value is not representable!");
To me an i1 -1 makes no sense whatsoever. It is not representable in
twos-complement form. It cannot be distinguished from unsigned i1 1.
It turns out this assert triggers all over the place. Before I dive
into this rat hole I'd like to confirm with others my sense that we
shouldn't be creating i1 -1 values. Is there some legitimate reason to
do so?
-David
More information about the llvm-dev
mailing list