summaryrefslogtreecommitdiff
path: root/llvm/unittests/CodeGen/RegisterTest.cpp
AgeCommit message (Collapse)Author
2025-11-05[CodeGen] Allow negative frame indicies in Register class. (#164459)Mikhail Gudim
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@ventanamicro.com> Co-authored-by: Petr Penzin <ppenzin@tenstorrent.com>