[PATCH] D43274: [RegisterClassInfo] Invalidate the register pressure set limit cache when reserved regs or callee saved regs change

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 10:58:10 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL325153: [RegisterClassInfo] Invalidate the register pressure set limit cache when… (authored by ctopper, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43274?vs=134157&id=134268#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D43274

Files:
  llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp


Index: llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp
+++ llvm/trunk/lib/CodeGen/RegisterClassInfo.cpp
@@ -49,9 +49,6 @@
   if (MF->getSubtarget().getRegisterInfo() != TRI) {
     TRI = MF->getSubtarget().getRegisterInfo();
     RegClass.reset(new RCInfo[TRI->getNumRegClasses()]);
-    unsigned NumPSets = TRI->getNumRegPressureSets();
-    PSetLimits.reset(new unsigned[NumPSets]);
-    std::fill(&PSetLimits[0], &PSetLimits[NumPSets], 0);
     Update = true;
   }
 
@@ -80,8 +77,12 @@
   }
 
   // Invalidate cached information from previous function.
-  if (Update)
+  if (Update) {
+    unsigned NumPSets = TRI->getNumRegPressureSets();
+    PSetLimits.reset(new unsigned[NumPSets]);
+    std::fill(&PSetLimits[0], &PSetLimits[NumPSets], 0);
     ++Tag;
+  }
 }
 
 /// compute - Compute the preferred allocation order for RC with reserved


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43274.134268.patch
Type: text/x-patch
Size: 959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180214/ecacd543/attachment.bin>


More information about the llvm-commits mailing list