It's not enough to just make sure destination type is floating point, because the following chain may be incorrectly optimized: ```LLVM %trunc = fptrunc float %src to bfloat %cast = bitcast bfloat %trunc to half ``` Before the fix, the instruction sequence mentioned above used to be translated into single fptrunc instruction as follows: ```LLVM %trunc = fptrunc float %src to half ``` Such transformation was semantically incorrect.
179 KiB
179 KiB