Skip to content

Commit c2ddfa8

Browse files
committed
[X86] Simplify code by removing an unreachable condition. NFCI
For X87<->SSE conversions, the SSE type is always smaller than the X87 type. So we can always use the smallest type for the memory type.
1 parent 5fe5c0a commit c2ddfa8

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -1058,12 +1058,7 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
10581058
// Here we could have an FP stack truncation or an FPStack <-> SSE convert.
10591059
// FPStack has extload and truncstore. SSE can fold direct loads into other
10601060
// operations. Based on this, decide what we want to do.
1061-
MVT MemVT;
1062-
if (N->getOpcode() == ISD::FP_ROUND)
1063-
MemVT = DstVT; // FP_ROUND must use DstVT, we can't do a 'trunc load'.
1064-
else
1065-
MemVT = SrcIsSSE ? SrcVT : DstVT;
1066-
1061+
MVT MemVT = (N->getOpcode() == ISD::FP_ROUND) ? DstVT : SrcVT;
10671062
SDValue MemTmp = CurDAG->CreateStackTemporary(MemVT);
10681063
SDLoc dl(N);
10691064

@@ -1116,12 +1111,7 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
11161111
// Here we could have an FP stack truncation or an FPStack <-> SSE convert.
11171112
// FPStack has extload and truncstore. SSE can fold direct loads into other
11181113
// operations. Based on this, decide what we want to do.
1119-
MVT MemVT;
1120-
if (N->getOpcode() == ISD::STRICT_FP_ROUND)
1121-
MemVT = DstVT; // FP_ROUND must use DstVT, we can't do a 'trunc load'.
1122-
else
1123-
MemVT = SrcIsSSE ? SrcVT : DstVT;
1124-
1114+
MVT MemVT = (N->getOpcode() == ISD::STRICT_FP_ROUND) ? DstVT : SrcVT;
11251115
SDValue MemTmp = CurDAG->CreateStackTemporary(MemVT);
11261116
SDLoc dl(N);
11271117

0 commit comments

Comments
 (0)