Skip to content

Commit 9269752

Browse files
committed
[AArch64] Fix assert AArch64TargetLowering::ReplaceNodeResults
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. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D107452
1 parent b8f612e commit 9269752

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17320,6 +17320,8 @@ void AArch64TargetLowering::ReplaceNodeResults(
1732017320
return;
1732117321
case ISD::FP_TO_UINT:
1732217322
case ISD::FP_TO_SINT:
17323+
case ISD::STRICT_FP_TO_SINT:
17324+
case ISD::STRICT_FP_TO_UINT:
1732317325
assert(N->getValueType(0) == MVT::i128 && "unexpected illegal conversion");
1732417326
// Let normal code take care of it by not adding anything to Results.
1732517327
return;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; RUN: llc < %s | FileCheck %s
2+
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
3+
target triple = "aarch64-arm-none-eabi"
4+
5+
define i128 @test_fixtfti(fp128 %ld) {
6+
; CHECK-LABEL: test_fixtfti:
7+
; CHECK: bl __fixtfti
8+
entry:
9+
%conv = call i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128 %ld, metadata !"fpexcept.strict")
10+
ret i128 %conv
11+
}
12+
13+
declare i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128, metadata)
14+
15+
define i128 @test_fixtftu(fp128 %ld) {
16+
; CHECK-LABEL: test_fixtftu:
17+
; CHECK: bl __fixunstfti
18+
entry:
19+
%conv = call i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128 %ld, metadata !"fpexcept.strict")
20+
ret i128 %conv
21+
}
22+
23+
declare i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128, metadata)

0 commit comments

Comments
 (0)