It seems only 1 can be a possible condition value from a valid LLVM IR, and if that's the case, I think what we need in this case is UndefinedBooleanContent. And I guess that should be the case for all other wasm instructions, but if we comment out this line, a bunch of test fails... Not sure why we need that line and what makes this case exceptional. Could you check?
I checked it out. The BooleanContents value is used to describe both how bools are produced and how bools are consumed. ZeroOrOneBooleanContent is a correct value for WebAssembly because all of our instructions that produce bools produce either zero or one. Setting the BooleanContents to UndefinedBooleanContent causes LLVM to emit and 1 after every instruction that produces a bool (or at least after instructions that produce bools that are returned from functions). That is why the tests are failing. I'm not sure why LLVM explicitly zeros the high bits instead of leaving them undefined.
I suppose ideally we would be able to separately specify that instructions that produce bools produce either zeros or ones and instructions that consume bools can consume zeros or nonzeros, rather than using a single configuration option for both producers and consumers of bools.