[llvm] [DAGCombiner] Narrow the integer source of uint_to_fp (PR #222899)
Dmitry Sidorov via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 17 03:29:33 PDT 2026
================
@@ -20641,6 +20641,32 @@ SDValue DAGCombiner::visitUINT_TO_FP(SDNode *N) {
if (SDValue FTrunc = foldFPToIntToFP(N, DL, DAG, TLI))
return FTrunc;
+ // fold (uint_to_fp x) -> (uint_to_fp (trunc x)) when the value of x is known
----------------
MrSidims wrote:
Routine from https://github.com/llvm/llvm-project/pull/224242 is almost the same as here. I suggest to introduce a single utility function use for both singed and unsigned conversion. Also, given that the routine is essentially the same - it would make sense to handle both conversions in a single PR.
https://github.com/llvm/llvm-project/pull/222899
More information about the llvm-commits
mailing list