102 ms·
I mean, it's undefined behaviour. The current transformation is correct, but so is the one proposed in OP's link. In fact, any transformation would be correct,
by tsukikage 6y ago
I mean, it's undefined behaviour. The current transformation is correct, but so is the one proposed in OP's link. In fact, any transformation would be correct, as would nasal demons.
An actually interesting question might be: which of the correct transformations is the more useful?
- devit 6y agoLLVM undef does not mean "undefined behavior", it means that it's OK to transform any use of it into the use of an arbitrary value (potentially different, unless the freeze instruction is used). To get undefined behavior, you need to do something like use the unreachable instruction, or call a noreturn function that does in fact return. You may also have "poison values", which trigger undefined behavior on certain uses.