[llvm] r190584 - Fix crash in AggressiveAntiDepBreaker with empty CriticalPathSet

Hal Finkel hfinkel at anl.gov
Wed Sep 11 21:22:32 PDT 2013


Author: hfinkel
Date: Wed Sep 11 23:22:31 2013
New Revision: 190584

URL: http://llvm.org/viewvc/llvm-project?rev=190584&view=rev
Log:
Fix crash in AggressiveAntiDepBreaker with empty CriticalPathSet

If no register classes are added to CriticalPathRCs, then the CriticalPathSet
bitmask will be empty. In that case, ExcludeRegs must remain NULL or else this
line will cause a segfault:

  } else if ((ExcludeRegs != NULL) && ExcludeRegs->test(AntiDepReg)) {

I have no in-tree test case.

Modified:
    llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp

Modified: llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp?rev=190584&r1=190583&r2=190584&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp (original)
+++ llvm/trunk/lib/CodeGen/AggressiveAntiDepBreaker.cpp Wed Sep 11 23:22:31 2013
@@ -782,7 +782,7 @@ unsigned AggressiveAntiDepBreaker::Break
     if (MI == CriticalPathMI) {
       CriticalPathSU = CriticalPathStep(CriticalPathSU);
       CriticalPathMI = (CriticalPathSU) ? CriticalPathSU->getInstr() : 0;
-    } else {
+    } else if (CriticalPathSet.any()) {
       ExcludeRegs = &CriticalPathSet;
     }
 





More information about the llvm-commits mailing list