[SelectionDAG] Add FP_TO_UINT_SAT/FP_TO_SINT_SAT to computeKnownBits/computeNumSignBits.
authorCraig Topper <craig.topper@sifive.com>
Mon, 10 Jan 2022 01:28:04 +0000 (17:28 -0800)
committerCraig Topper <craig.topper@sifive.com>
Mon, 10 Jan 2022 01:48:05 +0000 (17:48 -0800)
commita500f7f48fdb64def09cb3b7487759b0972f2347
tree438e4b28ba1df5863dff424d184eb8ec9c0dc105
parent22430ede7e497d67c87fe900cc685690c5c3ec0c
[SelectionDAG] Add FP_TO_UINT_SAT/FP_TO_SINT_SAT to computeKnownBits/computeNumSignBits.

These nodes should saturate to their saturating VT. We can use this
information to know the bits past the VT are all zeros or all sign bits.

I think we might only have test coverage for the unsigned case. I'll
verify and add tests.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D116870
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/fcvt_combine.ll
llvm/test/CodeGen/AArch64/fptoui-sat-scalar.ll
llvm/test/CodeGen/RISCV/double-convert.ll
llvm/test/CodeGen/RISCV/float-convert.ll
llvm/test/CodeGen/RISCV/half-convert.ll
llvm/test/CodeGen/Thumb2/mve-fptoui-sat-vector.ll
llvm/test/CodeGen/Thumb2/mve-vcvt-float-to-fixed.ll