Skip to content

Commit 4a58936

Browse files
Fix missed case of switching getConstant to getTargetConstant. Try 2.
Summary: This fixes a crasher introduced by r372338. Reviewers: echristo, arsenm Subscribers: wdng, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67850 llvm-svn: 372434
1 parent eacbe1c commit 4a58936

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17608,7 +17608,7 @@ SDValue X86TargetLowering::LowerINSERT_VECTOR_ELT(SDValue Op,
1760817608
// operand form.
1760917609
N1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, MVT::v4f32, N1);
1761017610
return DAG.getNode(X86ISD::BLENDI, dl, VT, N0, N1,
17611-
DAG.getConstant(1, dl, MVT::i8));
17611+
DAG.getTargetConstant(1, dl, MVT::i8));
1761217612
}
1761317613
// Create this as a scalar to vector..
1761417614
N1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, MVT::v4f32, N1);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=sse4.2 | FileCheck %s
3+
4+
define void @csrot_(float* %0) {
5+
; CHECK-LABEL: csrot_:
6+
; CHECK: # %bb.0:
7+
; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
8+
; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
9+
; CHECK-NEXT: xorps %xmm0, %xmm1
10+
; CHECK-NEXT: blendps {{.*#+}} xmm1 = xmm1[0],mem[1,2,3]
11+
; CHECK-NEXT: movlps %xmm1, (%rax)
12+
; CHECK-NEXT: retq
13+
1:
14+
%2 = load float, float* %0, align 4
15+
%3 = fsub float -0.000000e+00, %2
16+
%4 = insertelement <2 x float> <float undef, float -0.000000e+00>, float %3, i32 0
17+
store <2 x float> %4, <2 x float>* undef, align 8
18+
ret void
19+
}

0 commit comments

Comments
 (0)