summaryrefslogtreecommitdiff
path: root/devel/llvm60/files/patch-head-r338689.diff
blob: c0a785e779ee8ccb6db17958acca1274a402a38e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
r338689 | dim | 2018-09-14 21:25:23 +0200 (Fri, 14 Sep 2018) | 12 lines

Pull in r335365 from upstream llvm trunk (by Krzysztof Parzyszek):

  Initialize LiveRegs once in BranchFolder::mergeCommonTails

This should fix '(TRI && "LivePhysRegs is not initialized."' assertions
when building the lang/qt5-qml port in certain configurations.

Approved by:	re (kib)
Reported by:	Piotr Kubaj <pkubaj@anongoth.pl>
PR:		231355
MFC after:	3 days

Index: lib/CodeGen/BranchFolding.cpp
===================================================================
--- lib/CodeGen/BranchFolding.cpp	(revision 338688)
+++ lib/CodeGen/BranchFolding.cpp	(revision 338689)
@@ -884,11 +884,12 @@ void BranchFolder::mergeCommonTails(unsigned commo
   if (UpdateLiveIns) {
     LivePhysRegs NewLiveIns(*TRI);
     computeLiveIns(NewLiveIns, *MBB);
+    LiveRegs.init(*TRI);
 
     // The flag merging may lead to some register uses no longer using the
     // <undef> flag, add IMPLICIT_DEFs in the predecessors as necessary.
     for (MachineBasicBlock *Pred : MBB->predecessors()) {
-      LiveRegs.init(*TRI);
+      LiveRegs.clear();
       LiveRegs.addLiveOuts(*Pred);
       MachineBasicBlock::iterator InsertBefore = Pred->getFirstTerminator();
       for (unsigned Reg : NewLiveIns) {