llvm.org GIT mirror llvm / eb18812
Commit some changes I had managed to lose last night while refactoring the code. Avoid change use of PHI instructions because it's not legal to insert any instructions before them. This fixes PR6027. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93335 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 10 years ago
3 changed file(s) with 53 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
109109 MachineInstr *UseMI = &*UI;
110110 if (UseMI == MI)
111111 continue;
112 if (UseMI->getOpcode() == TargetInstrInfo::PHI) {
113 ExtendLife = false;
114 continue;
115 }
116
112117 MachineBasicBlock *UseMBB = UseMI->getParent();
113118 if (UseMBB == MBB) {
114119 // Local uses that come after the extension.
116121 Uses.push_back(&UseMO);
117122 } else if (ReachedBBs.count(UseMBB))
118123 // Non-local uses where the result of extension is used. Always
119 // replace these.
124 // replace these unless it's a PHI.
120125 Uses.push_back(&UseMO);
121126 else if (Aggressive && DT->dominates(MBB, UseMBB))
122127 // We may want to extend live range of the extension result in order
0 ; RUN: llc < %s -mtriple=i386-pc-linux-gnu
1 ; PR6027
2
3 %class.OlsonTimeZone = type { i16, i32*, i8*, i16 }
4
5 define void @XX(%class.OlsonTimeZone* %this) align 2 {
6 entry:
7 %call = tail call i8* @_Z15uprv_malloc_4_2v()
8 %0 = bitcast i8* %call to double*
9 %tmp = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 3
10 %tmp2 = load i16* %tmp
11 %tmp525 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 0
12 %tmp626 = load i16* %tmp525
13 %cmp27 = icmp slt i16 %tmp2, %tmp626
14 br i1 %cmp27, label %bb.nph, label %for.end
15
16 for.cond:
17 %tmp6 = load i16* %tmp5
18 %cmp = icmp slt i16 %inc, %tmp6
19 %indvar.next = add i32 %indvar, 1
20 br i1 %cmp, label %for.body, label %for.end
21
22 bb.nph:
23 %tmp10 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 2
24 %tmp17 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 1
25 %tmp5 = getelementptr inbounds %class.OlsonTimeZone* %this, i32 0, i32 0
26 %tmp29 = sext i16 %tmp2 to i32
27 %tmp31 = add i16 %tmp2, 1
28 %tmp32 = zext i16 %tmp31 to i32
29 br label %for.body
30
31 for.body:
32 %indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %for.cond ]
33 %tmp30 = add i32 %indvar, %tmp29
34 %tmp33 = add i32 %indvar, %tmp32
35 %inc = trunc i32 %tmp33 to i16
36 %tmp11 = load i8** %tmp10
37 %arrayidx = getelementptr i8* %tmp11, i32 %tmp30
38 %tmp12 = load i8* %arrayidx
39 br label %for.cond
40
41 for.end:
42 ret void
43 }
44
45 declare i8* @_Z15uprv_malloc_4_2v()
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -relocation-model=pic -disable-fp-elim -color-ss-with-regs -stats -info-output-file - > %t
1 ; RUN: grep stackcoloring %t | grep "stack slot refs replaced with reg refs" | grep 9
1 ; RUN: grep stackcoloring %t | grep "stack slot refs replaced with reg refs" | grep 14
22
33 type { [62 x %struct.Bitvec*] } ; type %0
44 type { i8* } ; type %1