[PATCH] D74726: [FPEnv][ARM] Don't call mutateStrictFPToFP when lowering
John Brawn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 17 10:21:35 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG594a89f7270d: [FPEnv][ARM] Don't call mutateStrictFPToFP when lowering (authored by john.brawn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74726/new/
https://reviews.llvm.org/D74726
Files:
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/fp-intrinsics.ll
Index: llvm/test/CodeGen/ARM/fp-intrinsics.ll
===================================================================
--- llvm/test/CodeGen/ARM/fp-intrinsics.ll
+++ llvm/test/CodeGen/ARM/fp-intrinsics.ll
@@ -72,6 +72,21 @@
ret i32 %val
}
+; CHECK-LABEL: fptosi_f32_twice:
+; CHECK-NOSP: bl __aeabi_f2iz
+; CHECK-NOSP: bl __aeabi_f2iz
+; CHECK-SP: vcvt.s32.f32
+; FIXME-CHECK-SP: vcvt.s32.f32
+define void @fptosi_f32_twice(float %arg, i32* %ptr) #0 {
+entry:
+ %conv = call i32 @llvm.experimental.constrained.fptosi.f32(float %arg, metadata !"fpexcept.strict") #0
+ store i32 %conv, i32* %ptr, align 4
+ %conv1 = call i32 @llvm.experimental.constrained.fptosi.f32(float %arg, metadata !"fpexcept.strict") #0
+ %idx = getelementptr inbounds i32, i32* %ptr, i32 1
+ store i32 %conv1, i32* %idx, align 4
+ ret void
+}
+
; CHECK-LABEL: fptoui_f32:
; CHECK-NOSP: bl __aeabi_f2uiz
; FIXME-CHECK-SP: vcvt.u32.f32
@@ -80,6 +95,21 @@
ret i32 %val
}
+; CHECK-LABEL: fptoui_f32_twice:
+; CHECK-NOSP: bl __aeabi_f2uiz
+; CHECK-NOSP: bl __aeabi_f2uiz
+; FIXME-CHECK-SP: vcvt.u32.f32
+; FIXME-CHECK-SP: vcvt.u32.f32
+define void @fptoui_f32_twice(float %arg, i32* %ptr) #0 {
+entry:
+ %conv = call i32 @llvm.experimental.constrained.fptoui.f32(float %arg, metadata !"fpexcept.strict") #0
+ store i32 %conv, i32* %ptr, align 4
+ %conv1 = call i32 @llvm.experimental.constrained.fptoui.f32(float %arg, metadata !"fpexcept.strict") #0
+ %idx = getelementptr inbounds i32, i32* %ptr, i32 1
+ store i32 %conv1, i32* %idx, align 4
+ ret void
+}
+
; CHECK-LABEL: sqrt_f32:
; CHECK-NOSP: bl sqrtf
; CHECK-SP: vsqrt.f32
@@ -947,6 +977,21 @@
ret double %val
}
+; CHECK-LABEL: fpext_f32_twice:
+; CHECK-NODP: bl __aeabi_f2d
+; CHECK-NODP: bl __aeabi_f2d
+; CHECK-DP: vcvt.f64.f32
+; FIXME-CHECK-DP: vcvt.f64.f32
+define void @fpext_f32_twice(float %arg, double* %ptr) #0 {
+entry:
+ %conv1 = call double @llvm.experimental.constrained.fpext.f64.f32(float %arg, metadata !"fpexcept.strict") #0
+ store double %conv1, double* %ptr, align 8
+ %conv2 = call double @llvm.experimental.constrained.fpext.f64.f32(float %arg, metadata !"fpexcept.strict") #0
+ %idx = getelementptr inbounds double, double* %ptr, i32 1
+ store double %conv2, double* %idx, align 8
+ ret void
+}
+
; CHECK-LABEL: sitofp_f32_i32:
; CHECK-NOSP: bl __aeabi_i2f
; FIXME-CHECK-SP: vcvt.f32.s32
Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -5425,7 +5425,12 @@
// FIXME: Remove this when we have strict fp instruction selection patterns
if (IsStrict) {
- DAG.mutateStrictFPToFP(Op.getNode());
+ SDLoc Loc(Op);
+ SDValue Result =
+ DAG.getNode(Op.getOpcode() == ISD::STRICT_FP_TO_SINT ? ISD::FP_TO_SINT
+ : ISD::FP_TO_UINT,
+ Loc, Op.getValueType(), SrcVal);
+ return DAG.getMergeValues({Result, Op.getOperand(0)}, Loc);
}
return Op;
@@ -16532,7 +16537,10 @@
if (SrcSz == 32 && DstSz == 64 && Subtarget->hasFP64()) {
// FIXME: Remove this when we have strict fp instruction selection patterns
if (IsStrict) {
- DAG.mutateStrictFPToFP(Op.getNode());
+ SDLoc Loc(Op);
+ SDValue Result = DAG.getNode(ISD::FP_EXTEND,
+ Loc, Op.getValueType(), SrcVal);
+ return DAG.getMergeValues({Result, Op.getOperand(0)}, Loc);
}
return Op;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74726.245005.patch
Type: text/x-patch
Size: 3561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200217/1cef6af5/attachment.bin>
More information about the llvm-commits
mailing list