[llvm] [X86][BreakFalseDeps] Using reverse order for undef register selection (PR #137569)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 01:12:06 PDT 2025


================
@@ -39,14 +39,16 @@ StressRA("stress-regalloc", cl::Hidden, cl::init(0), cl::value_desc("N"),
 
 RegisterClassInfo::RegisterClassInfo() = default;
 
-void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
+void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf,
+                                             bool Rev) {
   bool Update = false;
   MF = &mf;
 
   auto &STI = MF->getSubtarget();
 
   // Allocate new array the first time we see a new target.
-  if (STI.getRegisterInfo() != TRI) {
+  if (STI.getRegisterInfo() != TRI || Reverse != Rev) {
----------------
phoebewang wrote:

TRI is a constant value within the same Subtarget, but can be changed when we compile functions with different target feature. So we need to reset RegClass in these cases.

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


More information about the llvm-commits mailing list