forked from OSchip/llvm-project
				
			PR20557: Fix the bug that bogus cpu parameter crashes llc on AArch64 backend.
Initial patch by Oleg Ranevskyy. llvm-svn: 220945
This commit is contained in:
		
							parent
							
								
									6256a0ea8f
								
							
						
					
					
						commit
						e02b1a068f
					
				| 
						 | 
				
			
			@ -1200,8 +1200,12 @@ void TargetLoweringBase::computeRegisterProperties() {
 | 
			
		|||
        TransformToType[i] = MVT::Other;
 | 
			
		||||
        if (PreferredAction == TypeScalarizeVector)
 | 
			
		||||
          ValueTypeActions.setTypeAction(VT, TypeScalarizeVector);
 | 
			
		||||
        else
 | 
			
		||||
        else if (PreferredAction == TypeSplitVector)
 | 
			
		||||
          ValueTypeActions.setTypeAction(VT, TypeSplitVector);
 | 
			
		||||
        else
 | 
			
		||||
          // Set type action according to the number of elements.
 | 
			
		||||
          ValueTypeActions.setTypeAction(VT, NElts == 1 ? TypeScalarizeVector
 | 
			
		||||
                                                        : TypeSplitVector);
 | 
			
		||||
      } else {
 | 
			
		||||
        TransformToType[i] = NVT;
 | 
			
		||||
        ValueTypeActions.setTypeAction(VT, TypeWidenVector);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
; RUN: llc -march=aarch64 -mcpu=bogus -o - %s
 | 
			
		||||
 | 
			
		||||
; Fix the bug in PR20557. Set mcpu to a bogus name, llc will crash in type
 | 
			
		||||
; legalization.
 | 
			
		||||
define <4 x float> @fneg4(<4 x float> %x) {
 | 
			
		||||
  %sub = fsub <4 x float> zeroinitializer, %x
 | 
			
		||||
  ret <4 x float> %sub
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue