My earlier "fix" for PBQP (see r165201) was incorrect. The real issue was that
authorLang Hames <lhames@gmail.com>
Wed, 10 Oct 2012 06:39:48 +0000 (06:39 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 10 Oct 2012 06:39:48 +0000 (06:39 +0000)
checkRegMaskInterference only initializes the bitmask on the first interference.

This fixes PR14027 and (re)fixes PR13945.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165608 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocPBQP.cpp

index f2473681a5dd54b81134eee3880a3ca59e5b8b4d..984aab2a7a812359c45928eab14d3cebac21c209 100644 (file)
@@ -218,7 +218,7 @@ std::auto_ptr<PBQPRAProblem> PBQPBuilder::build(MachineFunction *mf,
     LiveInterval *vregLI = &LIS->getInterval(vreg);
 
     // Record any overlaps with regmask operands.
-    BitVector regMaskOverlaps(tri->getNumRegs());
+    BitVector regMaskOverlaps;
     LIS->checkRegMaskInterference(*vregLI, regMaskOverlaps);
 
     // Compute an initial allowed set for the current vreg.
@@ -231,7 +231,7 @@ std::auto_ptr<PBQPRAProblem> PBQPBuilder::build(MachineFunction *mf,
         continue;
 
       // vregLI crosses a regmask operand that clobbers preg.
-      if (!regMaskOverlaps.empty() && regMaskOverlaps.test(preg))
+      if (!regMaskOverlaps.empty() && !regMaskOverlaps.test(preg))
         continue;
 
       // vregLI overlaps fixed regunit interference.