mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	[LLVM part] These patches rename the loop unrolling and loop vectorizer metadata such that they have a common 'llvm.loop.' prefix. Metadata name changes: llvm.vectorizer.* => llvm.loop.vectorizer.* llvm.loopunroll.* => llvm.loop.unroll.* This was a suggestion from an earlier review (http://reviews.llvm.org/D4090) which added the loop unrolling metadata. Patch by Mark Heffernan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211710 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
| ; RUN: opt < %s  -loop-vectorize -force-vector-unroll=1 -dce -instcombine -S | FileCheck %s
 | |
| 
 | |
| target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 | |
| target triple = "x86_64-unknown-linux-gnu"
 | |
| 
 | |
| ; CHECK-LABEL: @test1(
 | |
| ; CHECK: store <8 x i32>
 | |
| ; CHECK: ret void
 | |
| define void @test1(i32* nocapture %a, i32 %n) #0 {
 | |
| entry:
 | |
|   %cmp4 = icmp sgt i32 %n, 0
 | |
|   br i1 %cmp4, label %for.body, label %for.end
 | |
| 
 | |
| for.body:                                         ; preds = %entry, %for.body
 | |
|   %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
 | |
|   %arrayidx = getelementptr inbounds i32* %a, i64 %indvars.iv
 | |
|   %0 = trunc i64 %indvars.iv to i32
 | |
|   store i32 %0, i32* %arrayidx, align 4
 | |
|   %indvars.iv.next = add i64 %indvars.iv, 1
 | |
|   %lftr.wideiv = trunc i64 %indvars.iv.next to i32
 | |
|   %exitcond = icmp eq i32 %lftr.wideiv, %n
 | |
|   br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
 | |
| 
 | |
| for.end:                                          ; preds = %for.body, %entry
 | |
|   ret void
 | |
| }
 | |
| 
 | |
| attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
 | |
| 
 | |
| !0 = metadata !{metadata !0, metadata !1}
 | |
| !1 = metadata !{metadata !"llvm.loop.vectorize.width", i32 8}
 |