[llvm] [InlineSpiller] Drop unused elements in Virt2SiblingsMap. NFC (PR #147866)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 00:28:52 PDT 2025


csstormq wrote:

> I don't understand this. 0 isn't an invalid register index, it's the first valid virtual register index.

@arsenm , thanks for your review. In my opinion, the key of `Virt2SiblingsMap` (the original register) should always hold the equal value as its corresponding value (the sibling register). However, the `getPreSplitReg` function returns 0, register number rather than register index, when encountering a register that was not created by splitting. Consequently, `Virt2SiblingsMap[0]` ends up storing registers with differing values, which directly contradicts the map's design principle.

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


More information about the llvm-commits mailing list