[llvm] [RFC][MC] Cache MCRegAliasIterator (PR #93510)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 02:50:56 PDT 2024


================
@@ -187,6 +187,9 @@ class MCRegisterInfo {
   DenseMap<MCRegister, int> L2SEHRegs;        // LLVM to SEH regs mapping
   DenseMap<MCRegister, int> L2CVRegs;         // LLVM to CV regs mapping
 
+  mutable std::vector<std::vector<MCPhysReg>> RegAliasesCache;
----------------
jayfoad wrote:

> SmallVector should be 16 bytes large if the element type is 4 bytes... uh, I just saw that MCPhyReg is only 2 bytes, which increases SmallVector size to 24 bytes.

Why does it get bigger when the element type gets smaller? Is it worth fixing that?

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


More information about the llvm-commits mailing list