[ConstantFold] Use getFltSemantics instead of manually checking the type
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 5 May 2022 13:50:33 +0000 (15:50 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 5 May 2022 13:52:19 +0000 (15:52 +0200)
commit08b20f20d2854377009822dfe597c78a4bf18de8
tree049e81e89c97608887fcf40d0c23878bbd013a45
parent47bdea3f7eb4bb70288e69635d73807c5d03dacc
[ConstantFold] Use getFltSemantics instead of manually checking the type

Simplifies the code and makes fpext/fptrunc constant folding not crash
when the result is bf16.
llvm/lib/IR/ConstantFold.cpp
llvm/test/Transforms/InstSimplify/ConstProp/cast.ll