[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:16 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) {
+ // We only know how to handle situations where the legal type is wider.
+ DAG.getContext()->emitError("CONVERT_TO_ARBITRARY_FP: the requested i32 "
+ "type for its legalization is not supported");
+ return SDValue();
----------------
arsenm wrote:
Should return poison and ideally would test this case
https://github.com/llvm/llvm-project/pull/221358
More information about the llvm-branch-commits
mailing list