Suppose we start when an SSA-style function with inputs x and y:
0
And we rewrite it as: let z = x +nsw y --or anything else that is UB for some input
0
The original code is a function that takes x and y and returns an instance of iN {n}, namely bitvec 0.The new code also takes any input to bitvec 0, although it may discard a poison value along the way. But this is UB in the C model!
I wonder whether this situation can be avoided by declaring that there is no control flow and that the program representation disallows discarding values. (And select would need to return poison if any argument is poison even if the selector says that the poison is not used.)
For what moral reasons would I avoid linking LLVM? I’m not familiar.