mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
87a2b36cf6
Summary: Instead of specifying the alignment as metadata which may be destroyed by transformation passes, make the alignment the second argument to ldu/ldg intrinsic calls. Test Plan: ldu-ldg.ll ldu-i8.ll ldu-reg-plus-offset.ll Reviewers: eliben, meheff, jholewinski Reviewed By: meheff, jholewinski Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D5093 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216731 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
1.1 KiB
LLVM
37 lines
1.1 KiB
LLVM
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
|
|
|
|
|
|
declare i8 @llvm.nvvm.ldu.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 %align)
|
|
declare i32 @llvm.nvvm.ldu.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 %align)
|
|
declare i8 @llvm.nvvm.ldg.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 %align)
|
|
declare i32 @llvm.nvvm.ldg.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 %align)
|
|
|
|
|
|
; CHECK: func0
|
|
define i8 @func0(i8 addrspace(1)* %ptr) {
|
|
; ldu.global.u8
|
|
%val = tail call i8 @llvm.nvvm.ldu.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 4)
|
|
ret i8 %val
|
|
}
|
|
|
|
; CHECK: func1
|
|
define i32 @func1(i32 addrspace(1)* %ptr) {
|
|
; ldu.global.u32
|
|
%val = tail call i32 @llvm.nvvm.ldu.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 4)
|
|
ret i32 %val
|
|
}
|
|
|
|
; CHECK: func2
|
|
define i8 @func2(i8 addrspace(1)* %ptr) {
|
|
; ld.global.nc.u8
|
|
%val = tail call i8 @llvm.nvvm.ldg.global.i.i8.p1i8(i8 addrspace(1)* %ptr, i32 4)
|
|
ret i8 %val
|
|
}
|
|
|
|
; CHECK: func3
|
|
define i32 @func3(i32 addrspace(1)* %ptr) {
|
|
; ld.global.nc.u32
|
|
%val = tail call i32 @llvm.nvvm.ldg.global.i.i32.p1i32(i32 addrspace(1)* %ptr, i32 4)
|
|
ret i32 %val
|
|
}
|