Skip to content

Commit 4cdbc89

Browse files
committed
Fix WidenVectorResult
1 parent 7911692 commit 4cdbc89

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5626,6 +5626,9 @@ SDValue DAGTypeLegalizer::WidenVecRes_Unary(SDNode *N) {
56265626
SDValue InOp = GetWidenedVector(N->getOperand(0));
56275627
if (N->getNumOperands() == 1)
56285628
return DAG.getNode(N->getOpcode(), SDLoc(N), WidenVT, InOp, N->getFlags());
5629+
if (N->getOpcode() == ISD::AssertNoFPClass)
5630+
return DAG.getNode(N->getOpcode(), SDLoc(N), WidenVT, InOp,
5631+
N->getOperand(1), N->getFlags());
56295632

56305633
assert(N->getNumOperands() == 3 && "Unexpected number of operands!");
56315634
assert(N->isVPOpcode() && "Expected VP opcode");

llvm/test/CodeGen/X86/nofpclass.ll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=-sse2,-sse | FileCheck %s --check-prefix=NOSSE
3+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=SSE
4+
5+
@gf = global { float, float } zeroinitializer, align 8
6+
7+
define void @f(<2 x float> noundef nofpclass(nan inf) %e.coerce) {
8+
; NOSSE-LABEL: f:
9+
; NOSSE: # %bb.0: # %entry
10+
; NOSSE-NEXT: flds {{[0-9]+}}(%rsp)
11+
; NOSSE-NEXT: flds {{[0-9]+}}(%rsp)
12+
; NOSSE-NEXT: movq gf@GOTPCREL(%rip), %rax
13+
; NOSSE-NEXT: fstps 4(%rax)
14+
; NOSSE-NEXT: fstps (%rax)
15+
; NOSSE-NEXT: retq
16+
;
17+
; SSE-LABEL: f:
18+
; SSE: # %bb.0: # %entry
19+
; SSE-NEXT: movq gf@GOTPCREL(%rip), %rax
20+
; SSE-NEXT: movlps %xmm0, (%rax)
21+
; SSE-NEXT: retq
22+
entry:
23+
store <2 x float> %e.coerce, ptr @gf, align 8
24+
ret void
25+
}

0 commit comments

Comments
 (0)