[AVX] Implement 256-bit vector lowering for SCALAR_TO_VECTOR. This
largely completes support for 128-bit fallback lowering for code that is not 256-bit ready. llvm-svn: 125315
This commit is contained in:
		
							parent
							
								
									229ce2d5b1
								
							
						
					
					
						commit
						79827a5a26
					
				| 
						 | 
					@ -6116,7 +6116,25 @@ X86TargetLowering::LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SDValue
 | 
					SDValue
 | 
				
			||||||
X86TargetLowering::LowerSCALAR_TO_VECTOR(SDValue Op, SelectionDAG &DAG) const {
 | 
					X86TargetLowering::LowerSCALAR_TO_VECTOR(SDValue Op, SelectionDAG &DAG) const {
 | 
				
			||||||
 | 
					  LLVMContext *Context = DAG.getContext();
 | 
				
			||||||
  DebugLoc dl = Op.getDebugLoc();
 | 
					  DebugLoc dl = Op.getDebugLoc();
 | 
				
			||||||
 | 
					  EVT OpVT = Op.getValueType();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // If this is a 256-bit vector result, first insert into a 128-bit
 | 
				
			||||||
 | 
					  // vector and then insert into the 256-bit vector.
 | 
				
			||||||
 | 
					  if (OpVT.getSizeInBits() > 128) {
 | 
				
			||||||
 | 
					    // Insert into a 128-bit vector.
 | 
				
			||||||
 | 
					    EVT VT128 = EVT::getVectorVT(*Context,
 | 
				
			||||||
 | 
					                                 OpVT.getVectorElementType(),
 | 
				
			||||||
 | 
					                                 OpVT.getVectorNumElements() / 2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Op = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, VT128, Op.getOperand(0));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Insert the 128-bit vector.
 | 
				
			||||||
 | 
					    return Insert128BitVector(DAG.getNode(ISD::UNDEF, dl, OpVT), Op,
 | 
				
			||||||
 | 
					                              DAG.getConstant(0, MVT::i32),
 | 
				
			||||||
 | 
					                              DAG, dl);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (Op.getValueType() == MVT::v1i64 &&
 | 
					  if (Op.getValueType() == MVT::v1i64 &&
 | 
				
			||||||
      Op.getOperand(0).getValueType() == MVT::i64)
 | 
					      Op.getOperand(0).getValueType() == MVT::i64)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue