[llvm] [CodeGen] Use SmallVector for FixedStackPSVs (PR #91760)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 02:52:21 PDT 2024


================
@@ -122,7 +122,12 @@ const PseudoSourceValue *PseudoSourceValueManager::getJumpTable() {
 
 const PseudoSourceValue *
 PseudoSourceValueManager::getFixedStack(int FI) {
-  std::unique_ptr<FixedStackPseudoSourceValue> &V = FSValues[FI];
+  // Frame index is often continuously positive, but can be negative. Use
+  // zig-zag encoding for dense index into FSValues vector.
+  unsigned Idx = FI >= 0 ? FI << 1 : (-FI - 1) << 1 | 1;
----------------
aengelke wrote:

Good point, changed.

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


More information about the llvm-commits mailing list