[TableGen] Reduce the amount of storage space used for AddrSpaces in TypeSetByHwMode. NFC
We reserved 16 AddrSpaces in every TypeSetByHwMode. But we only ever use the first one on targets that make use of the AddrSpace feature. The vector was populated by pushing for each entry in the ArrayRef passed to the TypeSetByHwMode constructor. Each entry is a ValueTypeByHwMode that stores one VT for each HwMode. The vector is accessed by a loop in TypeSetByHwMode::getValueTypeByHwMode. That loop is over HwModes with in the TypeSetByHwMode. This is unrelated to how the vector was created. The entries in the vector don't represent HwModes. The targets that use AddrSpace don't make use of HwModes so the loop in getValueTypeByHwMode will only run 1 iteration. So we only the first entry in the vector is meaningful used. This patch simplifies things by storing only 1 AddrSpace in TypeSetByMode. Reducing the memory used by TypeSetByHwMode. More work will be needed to support HwModes with AddrSpace if we need a different AddrSpace for each HwMode. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D148194
Loading
Please sign in to comment