Imported Upstream version 5.18.0.205

Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-11-16 08:20:38 +00:00
parent 5cd5df71cc
commit 8e12397d70
28486 changed files with 3867013 additions and 66 deletions

View File

@ -0,0 +1,24 @@
; RUN: opt -S -mtriple=nvptx64-nvidia-cuda -infer-address-spaces %s | FileCheck %s
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
%struct.bar = type { float, float* }
@var1 = local_unnamed_addr addrspace(3) externally_initialized global %struct.bar undef, align 8
; CHECK-LABEL: @bug31948(
; CHECK: %tmp = load float*, float* addrspace(3)* getelementptr inbounds (%struct.bar, %struct.bar addrspace(3)* @var1, i64 0, i32 1), align 8
; CHECK: %tmp1 = load float, float* %tmp, align 4
; CHECK: store float %conv1, float* %tmp, align 4
; CHECK: store i32 32, i32 addrspace(3)* bitcast (float* addrspace(3)* getelementptr inbounds (%struct.bar, %struct.bar addrspace(3)* @var1, i64 0, i32 1) to i32 addrspace(3)*), align 4
define void @bug31948(float %a, float* nocapture readnone %x, float* nocapture readnone %y) local_unnamed_addr #0 {
entry:
%tmp = load float*, float** getelementptr (%struct.bar, %struct.bar* addrspacecast (%struct.bar addrspace(3)* @var1 to %struct.bar*), i64 0, i32 1), align 8
%tmp1 = load float, float* %tmp, align 4
%conv1 = fadd float %tmp1, 1.000000e+00
store float %conv1, float* %tmp, align 4
store i32 32, i32* bitcast (float** getelementptr (%struct.bar, %struct.bar* addrspacecast (%struct.bar addrspace(3)* @var1 to %struct.bar*), i64 0, i32 1) to i32*), align 4
ret void
}
attributes #0 = { norecurse nounwind }

View File

@ -0,0 +1,36 @@
; RUN: opt -S -mtriple=nvptx64-nvidia-cuda -infer-address-spaces %s | FileCheck %s
%struct.S = type { [5 x i32] }
$g1 = comdat any
@g1 = linkonce_odr addrspace(3) global %struct.S zeroinitializer, comdat, align 4
; CHECK-LABEL: @foo(
; CHECK: %x0 = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x() #2
; CHECK: %idxprom.i = zext i32 %x0 to i64
; CHECK: %arrayidx.i = getelementptr %struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 %idxprom.i
; CHECK: tail call void @f1(i32* %arrayidx.i, i32 undef) #0
; CHECK: %x1 = load i32, i32* getelementptr (%struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 0), align 4
; CHECK: %L.sroa.0.0.insert.ext.i = zext i32 %x1 to i64
; CHECK: tail call void @f2(i64* null, i64 %L.sroa.0.0.insert.ext.i) #0
; CHECK: ret void
define void @foo() local_unnamed_addr #0 {
entry:
%x0 = tail call i32 @llvm.nvvm.read.ptx.sreg.tid.x() #2
%idxprom.i = zext i32 %x0 to i64
%arrayidx.i = getelementptr %struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 %idxprom.i
tail call void @f1(i32* %arrayidx.i, i32 undef) #0
%x1 = load i32, i32* getelementptr (%struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 0), align 4
%L.sroa.0.0.insert.ext.i = zext i32 %x1 to i64
tail call void @f2(i64* null, i64 %L.sroa.0.0.insert.ext.i) #0
ret void
}
declare void @f1(i32*, i32) local_unnamed_addr #0
declare void @f2(i64*, i64) local_unnamed_addr #0
declare i32 @llvm.nvvm.read.ptx.sreg.tid.x() #1
attributes #0 = { convergent nounwind }
attributes #1 = { nounwind readnone }
attributes #2 = { nounwind }

View File

@ -0,0 +1,2 @@
if not 'NVPTX' in config.root.targets:
config.unsupported = True