Skip to content

Commit 4c4b821

Browse files
committed
[ARM] Mark function calls as possibly changing FPSCR
This patch does the same changes as D143001 for AArch64
1 parent 57e3f02 commit 4c4b821

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22003,6 +22003,11 @@ bool ARMTargetLowering::isComplexDeinterleavingOperationSupported(
2200322003
ScalarTy->isIntegerTy(32));
2200422004
}
2200522005

22006+
ArrayRef<MCPhysReg> ARMTargetLowering::getRoundingControlRegisters() const {
22007+
static const MCPhysReg RCRegs[] = {ARM::FPSCR};
22008+
return RCRegs;
22009+
}
22010+
2200622011
Value *ARMTargetLowering::createComplexDeinterleavingIR(
2200722012
IRBuilderBase &B, ComplexDeinterleavingOperation OperationType,
2200822013
ComplexDeinterleavingRotation Rotation, Value *InputA, Value *InputB,

llvm/lib/Target/ARM/ARMISelLowering.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,8 @@ class VectorType;
995995

996996
bool isUnsupportedFloatingType(EVT VT) const;
997997

998+
ArrayRef<MCPhysReg> getRoundingControlRegisters() const override;
999+
9981000
SDValue getCMOV(const SDLoc &dl, EVT VT, SDValue FalseVal, SDValue TrueVal,
9991001
SDValue ARMcc, SDValue Flags, SelectionDAG &DAG) const;
10001002
SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; RUN: llc -mtriple aarch64-none-linux-gnu -stop-after=finalize-isel %s -o - | FileCheck %s
2+
3+
define float @func_02(float %x, float %y) strictfp nounwind {
4+
%call = call float @func_01(float %x) strictfp
5+
%res = call float @llvm.experimental.constrained.fadd.f32(float %call, float %y, metadata !"round.dynamic", metadata !"fpexcept.ignore") strictfp
6+
ret float %res
7+
}
8+
; CHECK-LABEL: name: func_02
9+
; CHECK: BL @func_01, {{.*}}, implicit-def $fpcr
10+
11+
12+
declare float @func_01(float)
13+
declare float @llvm.experimental.constrained.fadd.f32(float, float, metadata, metadata)

0 commit comments

Comments
 (0)