Module: Mesa
Branch: main
Commit: 3c0f8aec844ad60244ea4c79dfda34e49fa76c03
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c0f8aec844ad60244ea4c79dfda34e49fa76c03

Author: M Henning <[email protected]>
Date:   Fri May 12 22:08:50 2023 -0400

nv50/ir: Remove Function.stackPtr

Reviewed-by: Karol Herbst <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23006>

---

 src/nouveau/codegen/nv50_ir.h      |  2 --
 src/nouveau/codegen/nv50_ir_bb.cpp |  1 -
 src/nouveau/codegen/nv50_ir_ra.cpp | 15 +++++----------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/nouveau/codegen/nv50_ir.h b/src/nouveau/codegen/nv50_ir.h
index d734528610a..decc7b91ca4 100644
--- a/src/nouveau/codegen/nv50_ir.h
+++ b/src/nouveau/codegen/nv50_ir.h
@@ -1289,8 +1289,6 @@ public:
    uint32_t binPos;
    uint32_t binSize;
 
-   Value *stackPtr;
-
    uint32_t tlsBase; // base address for l[] space (if no stack pointer is 
used)
    uint32_t tlsSize;
 
diff --git a/src/nouveau/codegen/nv50_ir_bb.cpp 
b/src/nouveau/codegen/nv50_ir_bb.cpp
index df5b2226477..94c0f144945 100644
--- a/src/nouveau/codegen/nv50_ir_bb.cpp
+++ b/src/nouveau/codegen/nv50_ir_bb.cpp
@@ -41,7 +41,6 @@ Function::Function(Program *p, const char *fnName, uint32_t 
label)
    binPos = 0;
    binSize = 0;
 
-   stackPtr = NULL;
    tlsBase = 0;
    tlsSize = 0;
 
diff --git a/src/nouveau/codegen/nv50_ir_ra.cpp 
b/src/nouveau/codegen/nv50_ir_ra.cpp
index 666e2202940..fff32b5ba3d 100644
--- a/src/nouveau/codegen/nv50_ir_ra.cpp
+++ b/src/nouveau/codegen/nv50_ir_ra.cpp
@@ -1580,14 +1580,10 @@ SpillCodeInserter::assignSlot(const Interval &livei, 
const unsigned int size)
    int32_t offset;
    std::list<SpillSlot>::iterator pos = slots.end(), it = slots.begin();
 
-   if (!func->stackPtr) {
-      // Later, we compute the address as (offsetBase + tlsBase)
-      // tlsBase might not be size-aligned, so we add just enough
-      // to give the final address the correct alignment
-      offsetBase = align(offsetBase + func->tlsBase, size) - func->tlsBase;
-   } else {
-      offsetBase = align(offsetBase, size);
-   }
+   // Later, we compute the address as (offsetBase + tlsBase)
+   // tlsBase might not be size-aligned, so we add just enough
+   // to give the final address the correct alignment
+   offsetBase = align(offsetBase + func->tlsBase, size) - func->tlsBase;
 
    slot.sym = NULL;
 
@@ -1619,8 +1615,7 @@ SpillCodeInserter::assignSlot(const Interval &livei, 
const unsigned int size)
       stackSize = offset + size;
       slot.offset = offset;
       slot.sym = new_Symbol(func->getProgram(), FILE_MEMORY_LOCAL);
-      if (!func->stackPtr)
-         offset += func->tlsBase;
+      offset += func->tlsBase;
       slot.sym->setAddress(NULL, offset);
       slot.sym->reg.size = size;
       slots.insert(pos, slot)->occup.insert(livei);

Reply via email to