codegen: use new freeze intrinsics to avoid poison UB (#38977)
LLVM would likely be required to insert this anyways to make hoisting
legal (converting branches to and/or), so might as well add it
ourselves, so that users can legally write that code directly.