[llvm] [VirtRegMap] Replace a single value enum with a static constexpr member variable. NFC (PR #109010)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 12:43:28 PDT 2024


topperc wrote:

> > @MatzeB do you think it's possible to use INT_MAX instead of our own number here?
> 
> I don't remember if this value needs to match what we have to describe the virtual registers, but if so we need to stick to it. See `llvm/include/llvm/CodeGen/Register.h`
> 
> ```
>   //   [2^30;2^31) Stack slots. (Rarely used.)
> ```
> 
> @topperc double check if it needs to be connected and if not `INT_MAX` may be fine.

It looks like VirtRegMap stores the incoming stack slots numbers directly without converting them to this Register form. And I don't see anything that converts them to that form. So I think this constant just needs to be something that will never be a valid stack slot number.

https://github.com/llvm/llvm-project/pull/109010


More information about the llvm-commits mailing list