summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AggressiveAntiDepBreaker.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-09-12 04:22:31 +0000
committerHal Finkel <hfinkel@anl.gov>2013-09-12 04:22:31 +0000
commit9ec1a55a863f658292b19d7a3c167ba089134dff (patch)
treea297dafbfac88e335c39fe9e81cabab25d80830e /lib/CodeGen/AggressiveAntiDepBreaker.cpp
parenta3c2bcf0ee2f63584f7a1e9df9fa153a8b5dfea1 (diff)
downloadllvm-9ec1a55a863f658292b19d7a3c167ba089134dff.tar.gz
llvm-9ec1a55a863f658292b19d7a3c167ba089134dff.tar.bz2
llvm-9ec1a55a863f658292b19d7a3c167ba089134dff.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AggressiveAntiDepBreaker.cpp')
-rw-r--r--lib/CodeGen/AggressiveAntiDepBreaker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/lib/CodeGen/AggressiveAntiDepBreaker.cpp
index e0797079c5..2ee7767115 100644
--- a/lib/CodeGen/AggressiveAntiDepBreaker.cpp
+++ b/lib/CodeGen/AggressiveAntiDepBreaker.cpp
@@ -782,7 +782,7 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies(
if (MI == CriticalPathMI) {
CriticalPathSU = CriticalPathStep(CriticalPathSU);
CriticalPathMI = (CriticalPathSU) ? CriticalPathSU->getInstr() : 0;
- } else {
+ } else if (CriticalPathSet.any()) {
ExcludeRegs = &CriticalPathSet;
}