mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-03 14:21:30 +00:00 
			
		
		
		
	The existing code in getMemsetValue only handled integer-preferred types when
the fill value was not a constant. Make this more robust in two ways:
  1. If the preferred type is a floating-point value, do the mul-splat trick on
     the corresponding integer type and then bitcast.
  2. If the preferred type is a vector, do the mul-splat trick on one vector
     element, and then build a vector out of them.
Fixes PR22754 (although, we should also turn off use of vector types at -O0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233749 91177308-0d34-0410-b5e6-96231b3b80d8
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			592 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			592 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
; RUN: llc < %s | FileCheck %s
 | 
						|
target datalayout = "e-m:e-i64:64-n32:64"
 | 
						|
target triple = "powerpc64le"
 | 
						|
 | 
						|
; Function Attrs: nounwind
 | 
						|
define void @test_vsx() unnamed_addr #0 align 2 {
 | 
						|
entry:
 | 
						|
  %0 = load i32, i32* undef, align 4
 | 
						|
  %1 = trunc i32 %0 to i8
 | 
						|
  call void @llvm.memset.p0i8.i64(i8* null, i8 %1, i64 32, i32 1, i1 false)
 | 
						|
  ret void
 | 
						|
 | 
						|
; CHECK-LABEL: @test_vsx
 | 
						|
; CHECK: stxvd2x
 | 
						|
; CHECK: stxvd2x
 | 
						|
; CHECK: blr
 | 
						|
}
 | 
						|
 | 
						|
; Function Attrs: nounwind
 | 
						|
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #1
 | 
						|
 | 
						|
attributes #0 = { nounwind "target-cpu"="pwr8" }
 | 
						|
attributes #1 = { nounwind }
 | 
						|
 |