[PATCH] D107452: [AArch64] Fix assert AArch64TargetLowering::ReplaceNodeResults
Simon Wallis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 4 05:46:30 PDT 2021
simonwallis2 created this revision.
simonwallis2 added a reviewer: john.brawn.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
simonwallis2 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Don't know how to custom expand this
UNREACHABLE executed at llvm-project/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16788
The fix is to provide missing expansions for:
case ISD::STRICT_FP_TO_UINT:
case ISD::STRICT_FP_TO_SINT:
A test case is provided.
https://reviews.llvm.org/D107452
Files:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
Index: llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/fptosi-strictfp.ll
@@ -0,0 +1,24 @@
+; RUN: llc < %s | FileCheck %s
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-arm-none-eabi"
+
+define hidden void @test_fixtfti(fp128 %ld) local_unnamed_addr #0 {
+entry:
+ %conv = call i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128 %ld, metadata !"fpexcept.strict") #0
+ ret void
+}
+; CHECK: bl __fixtfti
+
+declare i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128, metadata) #1
+
+define hidden void @test_fixtftu(fp128 %ld) local_unnamed_addr #0 {
+entry:
+ %conv = call i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128 %ld, metadata !"fpexcept.strict") #0
+ ret void
+}
+; CHECK: bl __fixunstfti
+
+declare i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128, metadata) #1
+
+attributes #0 = { strictfp }
+attributes #1 = { inaccessiblememonly mustprogress nofree nosync nounwind willreturn }
Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -17320,6 +17320,8 @@
return;
case ISD::FP_TO_UINT:
case ISD::FP_TO_SINT:
+ case ISD::STRICT_FP_TO_SINT:
+ case ISD::STRICT_FP_TO_UINT:
assert(N->getValueType(0) == MVT::i128 && "unexpected illegal conversion");
// Let normal code take care of it by not adding anything to Results.
return;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107452.364071.patch
Type: text/x-patch
Size: 1644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210804/478bce34/attachment.bin>
More information about the llvm-commits
mailing list