mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
PTX: Fix some lingering issues with stack allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d5c3920f8d
commit
58788503b8
@ -297,7 +297,9 @@ void PTXAsmPrinter::EmitFunctionBodyStart() {
|
||||
for (unsigned i = 0, e = FrameInfo->getNumObjects(); i != e; ++i) {
|
||||
DEBUG(dbgs() << "Size of object: " << FrameInfo->getObjectSize(i) << "\n");
|
||||
if (FrameInfo->getObjectSize(i) > 0) {
|
||||
std::string def = "\t.local .b";
|
||||
std::string def = "\t.local .align ";
|
||||
def += utostr(FrameInfo->getObjectAlignment(i));
|
||||
def += " .b";
|
||||
def += utostr(FrameInfo->getObjectSize(i)*8); // Convert to bits
|
||||
def += " __local";
|
||||
def += utostr(i);
|
||||
|
10
test/CodeGen/PTX/stack-object.ll
Normal file
10
test/CodeGen/PTX/stack-object.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: llc < %s -march=ptx32 -mattr=sm20 | FileCheck %s
|
||||
|
||||
define ptx_device float @stack1(float %a) {
|
||||
; CHECK: .local .b32 __local0;
|
||||
%a.2 = alloca float
|
||||
; CHECK: st.local.f32 [__local0], %f0
|
||||
store float %a, float* %a.2
|
||||
%a.3 = load float* %a.2
|
||||
ret float %a.3
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user