diff options
| author | Cameron Zwarich <zwarich@apple.com> | 2011-02-27 08:06:01 +0000 |
|---|---|---|
| committer | Cameron Zwarich <zwarich@apple.com> | 2011-02-27 08:06:01 +0000 |
| commit | eee444cc4e248ae426cddfcb267eec8fb0fbf691 (patch) | |
| tree | f329bb8266cc3e6c9d36685227e940b93999886b /include | |
| parent | 60c8b22dad0403497d425f263de0a6b8716dd0a4 (diff) | |
Fix PR9324 / <rdar://problem/9052489> by handling the case where a PHI has no uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/CodeGen/FunctionLoweringInfo.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h index b41f30d825..7f41222d9b 100644 --- a/include/llvm/CodeGen/FunctionLoweringInfo.h +++ b/include/llvm/CodeGen/FunctionLoweringInfo.h @@ -187,7 +187,12 @@ public: /// InvalidatePHILiveOutRegInfo - Invalidates a PHI's LiveOutInfo, to be /// called when a block is visited before all of its predecessors. void InvalidatePHILiveOutRegInfo(const PHINode *PN) { - unsigned Reg = ValueMap[PN]; + // PHIs with no uses have no ValueMap entry. + DenseMap<const Value*, unsigned>::const_iterator It = ValueMap.find(PN); + if (It == ValueMap.end()) + return; + + unsigned Reg = It->second; LiveOutRegInfo.grow(Reg); LiveOutRegInfo[Reg].IsValid = false; } |
