mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Essentially the same as the GEP change in r230786.
A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)
import fileinput
import sys
import re
pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")
for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))
Reviewers: rafael, dexonsmith, grosser
Differential Revision: http://reviews.llvm.org/D7649
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
| ; RUN: opt < %s -mcpu=core-avx2 -loop-vectorize -S | llc -mcpu=core-avx2 | FileCheck %s
 | |
| 
 | |
| target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 | |
| target triple = "x86_64-apple-macosx"
 | |
| 
 | |
| @float_array = common global [10000 x float] zeroinitializer, align 16
 | |
| @unsigned_array = common global [10000 x i32] zeroinitializer, align 16
 | |
| 
 | |
| ; If we need to scalarize the fptoui and then use inserts to build up the
 | |
| ; vector again, then there is certainly no value in going 256-bit wide.
 | |
| ; CHECK-NOT: vinserti128
 | |
| 
 | |
| define void @convert(i32 %N) {
 | |
| entry:
 | |
|   %0 = icmp eq i32 %N, 0
 | |
|   br i1 %0, label %for.end, label %for.body.preheader
 | |
| 
 | |
| for.body.preheader:                               ; preds = %entry
 | |
|   br label %for.body
 | |
| 
 | |
| for.body:                                         ; preds = %for.body.preheader, %for.body
 | |
|   %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
 | |
|   %arrayidx = getelementptr inbounds [10000 x float], [10000 x float]* @float_array, i64 0, i64 %indvars.iv
 | |
|   %1 = load float, float* %arrayidx, align 4
 | |
|   %conv = fptoui float %1 to i32
 | |
|   %arrayidx2 = getelementptr inbounds [10000 x i32], [10000 x i32]* @unsigned_array, i64 0, i64 %indvars.iv
 | |
|   store i32 %conv, i32* %arrayidx2, align 4
 | |
|   %indvars.iv.next = add nuw nsw 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.loopexit, label %for.body
 | |
| 
 | |
| for.end.loopexit:                                 ; preds = %for.body
 | |
|   br label %for.end
 | |
| 
 | |
| for.end:                                          ; preds = %for.end.loopexit, %entry
 | |
|   ret void
 | |
| }
 | |
| 
 |