Skip to content

Commit 2a222d9

Browse files
committed
Use changeTypeToInteger
1 parent 0b28b84 commit 2a222d9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,9 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(SDNode *N) {
267267
SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_ELEMENT(SDNode *N) {
268268
SDValue Src = N->getOperand(0);
269269
assert(Src.getValueType() == MVT::ppcf128 &&
270-
Src.getOperand(0)->getOpcode() == ISD::BUILD_PAIR &&
271270
"In floats only ppcf128 can be extracted by element!");
272-
EVT DestVT = EVT::getIntegerVT(*DAG.getContext(), N->getValueSizeInBits(0));
273-
return DAG.getNode(ISD::EXTRACT_ELEMENT, SDLoc(N), DestVT,
271+
return DAG.getNode(ISD::EXTRACT_ELEMENT, SDLoc(N),
272+
N->getValueType(0).changeTypeToInteger(),
274273
Src.getOperand(0), N->getOperand(1));
275274
}
276275

llvm/test/CodeGen/PowerPC/ppcsoftops.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ define dso_local zeroext i32 @func(double noundef %0, double noundef %1) #0 {
7171
; To check ppc_fp128 soften without crash
7272
define zeroext i1 @ppcf128_soften(ppc_fp128 %a) #0 {
7373
entry:
74-
%0 = tail call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %a, i32 100)
75-
ret i1 %0
74+
%fpclass = tail call i1 @llvm.is.fpclass.ppcf128(ppc_fp128 %a, i32 100)
75+
ret i1 %fpclass
7676

7777
; CHECK-LABEL: ppcf128_soften
7878
}

0 commit comments

Comments
 (0)