[llvm-branch-commits] [llvm] [SelectionDAG] Fix incorrect expansion of `CONVERT_TO_ARBITRARY_FP` (PR #221358)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Sep 5 02:11:00 PDT 2026


================
@@ -9385,12 +9404,31 @@ SDValue TargetLowering::expandCONVERT_TO_ARBITRARY_FP(SDNode *Node,
   EVT FrexpExpScalarVT =
       getValueType(DAG.getDataLayout(), Type::getInt32Ty(*DAG.getContext()));
   EVT FrexpExpVT = SrcVT.changeElementType(*DAG.getContext(), FrexpExpScalarVT);
+  if (!FrexpExpVT.isVector() && !isTypeLegal(FrexpExpVT)) {
+    if (getTypeAction(*DAG.getContext(), FrexpExpScalarVT) !=
+        TypePromoteInteger) {
----------------
arsenm wrote:

Combine the getTypeAction and isTypeLegal?

https://github.com/llvm/llvm-project/pull/221358


More information about the llvm-branch-commits mailing list