Skip to content

Commit a37c8c7

Browse files
committed
Fix MERGE_VALUE cases
1 parent b10ba65 commit a37c8c7

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11828,9 +11828,18 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
1182811828
else if (Arg.hasAttribute(Attribute::ZExt))
1182911829
AssertOp = ISD::AssertZext;
1183011830

11831-
ArgValues.push_back(getCopyFromParts(DAG, dl, &InVals[i], NumParts,
11832-
PartVT, VT, nullptr, NewRoot,
11833-
F.getCallingConv(), AssertOp));
11831+
SDValue OutVal =
11832+
getCopyFromParts(DAG, dl, &InVals[i], NumParts, PartVT, VT, nullptr,
11833+
NewRoot, F.getCallingConv(), AssertOp);
11834+
11835+
FPClassTest NoFPClass = Arg.getNoFPClass();
11836+
if (NoFPClass != fcNone) {
11837+
SDValue SDNoFPClass = DAG.getTargetConstant(
11838+
static_cast<uint64_t>(NoFPClass), dl, MVT::i32);
11839+
OutVal = DAG.getNode(ISD::AssertNoFPClass, dl, OutVal.getValueType(),
11840+
OutVal, SDNoFPClass);
11841+
}
11842+
ArgValues.push_back(OutVal);
1183411843
}
1183511844

1183611845
i += NumParts;
@@ -11848,15 +11857,6 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
1184811857
SDValue Res = DAG.getMergeValues(ArrayRef(ArgValues.data(), NumValues),
1184911858
SDB->getCurSDLoc());
1185011859

11851-
FPClassTest NoFPClass = Arg.getNoFPClass();
11852-
if (NoFPClass != fcNone) {
11853-
SDValue SDNoFPClass =
11854-
DAG.getTargetConstant(static_cast<uint64_t>(NoFPClass), dl,
11855-
EVT::getIntegerVT(*DAG.getContext(), 32));
11856-
Res = DAG.getNode(ISD::AssertNoFPClass, dl, Res.getValueType(), Res,
11857-
SDNoFPClass);
11858-
}
11859-
1186011860
SDB->setValue(&Arg, Res);
1186111861
if (!TM.Options.EnableFastISel && Res.getOpcode() == ISD::BUILD_PAIR) {
1186211862
// We want to associate the argument with the frame index, among

llvm/test/CodeGen/AArch64/nofpclass.ll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ entry:
2020
%c = call <4 x float> @llvm.maximumnum.v4f32(<4 x float> %a, <4 x float> %b)
2121
ret <4 x float> %c
2222
}
23+
24+
define { float, float } @struct({ float, float } nofpclass(nan) %a) {
25+
; CHECK-LABEL: struct:
26+
; CHECK: // %bb.0:
27+
; CHECK-NEXT: ret
28+
ret {float, float} %a
29+
}

0 commit comments

Comments
 (0)