[all-commits] [llvm/llvm-project] 050cbd: [CodeGen] Allow negative frame indicies in Registe...

Mikhail Gudim via All-commits all-commits at lists.llvm.org
Wed Nov 5 15:33:42 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 050cbd297ba401cb4089e13c925f233d1d3af26e
      https://github.com/llvm/llvm-project/commit/050cbd297ba401cb4089e13c925f233d1d3af26e
  Author: Mikhail Gudim <mgudim at gmail.com>
  Date:   2025-11-05 (Wed, 05 Nov 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/Register.h
    M llvm/lib/CodeGen/ReachingDefAnalysis.cpp
    M llvm/unittests/CodeGen/CMakeLists.txt
    A llvm/unittests/CodeGen/RegisterTest.cpp

  Log Message:
  -----------
  [CodeGen] Allow negative frame indicies in Register class. (#164459)

The register values between `2 << 30` (inclusive) and `2 << 31`
(exclusive) correspond to frame indices. To obtain the frame index from
the given register value we interpret first 30 bits as an unsigned
integer. Thus, currently only non-negative frame indices can be
represented.

However, we should also be able to represent negative frame indices as
register values as well. This is used by reaching definitions analysis
for example.

In order to do that, we interpret the first 30 bits of the register
value as a signed integer.

---------

Co-authored-by: Mikhail Gudim <mgudim at ventanamicro.com>
Co-authored-by: Petr Penzin <ppenzin at tenstorrent.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list