mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-21 11:10:12 +00:00
Fix a DAGCombiner abort on a bitcast from a scalar to a vector.
llvm-svn: 43470
This commit is contained in:
parent
1c499173c8
commit
02b8beff5f
@ -4212,7 +4212,8 @@ SDOperand DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
unsigned NumElts = MVT::getVectorNumElements(VT);
|
||||
if (InVec.getOpcode() == ISD::BIT_CONVERT) {
|
||||
MVT::ValueType BCVT = InVec.getOperand(0).getValueType();
|
||||
if (NumElts != MVT::getVectorNumElements(BCVT))
|
||||
if (!MVT::isVector(BCVT) ||
|
||||
NumElts != MVT::getVectorNumElements(BCVT))
|
||||
return SDOperand();
|
||||
InVec = InVec.getOperand(0);
|
||||
EVT = MVT::getVectorElementType(BCVT);
|
||||
|
10
test/CodeGen/X86/bitcast-int-to-vector.ll
Normal file
10
test/CodeGen/X86/bitcast-int-to-vector.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llvm-as < %s | llc -march=x86
|
||||
|
||||
define i1 @foo(i64 %a)
|
||||
{
|
||||
%t = bitcast i64 %a to <2 x float>
|
||||
%r = extractelement <2 x float> %t, i32 0
|
||||
%s = extractelement <2 x float> %t, i32 1
|
||||
%b = fcmp uno float %r, %s
|
||||
ret i1 %b
|
||||
}
|
Loading…
Reference in New Issue
Block a user