llvm.org GIT mirror llvm / 6165dba
Stack Coloring: Handle the case where END markers come before BEGIN markers properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163530 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 8 years ago
2 changed file(s) with 39 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
314314 LocalLiveOut.reset(BlockLiveness[BB].End);
315315 LocalLiveIn.reset(BlockLiveness[BB].Begin);
316316
317 // If we have both BEGIN and END markers in the same basic block then
318 // we know that the BEGIN marker comes after the END, because we already
319 // handle the case where the BEGIN comes before the END when collecting
320 // the markers (and building the BEGIN/END vectore).
321 // Want to enable the LIVE_IN and LIVE_OUT of slots that have both
322 // BEGIN and END because it means that the value lives before and after
323 // this basic block.
324 BitVector LocalEndBegin = BlockLiveness[BB].End;
325 LocalEndBegin &= BlockLiveness[BB].Begin;
326 LocalLiveIn |= LocalEndBegin;
327 LocalLiveOut |= LocalEndBegin;
328
317329 if (LocalLiveIn.test(BlockLiveness[BB].LiveIn)) {
318330 changed = true;
319331 BlockLiveness[BB].LiveIn |= LocalLiveIn;
324324 ret void
325325 }
326326
327
328 ;YESCOLOR: subq $272, %rsp
329 ;NOCOLOR: subq $272, %rsp
330
331 define i32 @myCall_end_before_begin(i32 %in, i1 %d) {
332 entry:
333 %a = alloca [17 x i8*], align 8
334 %a2 = alloca [16 x i8*], align 8
335 %b = bitcast [17 x i8*]* %a to i8*
336 %b2 = bitcast [16 x i8*]* %a2 to i8*
337 %t1 = call i32 @foo(i32 %in, i8* %b)
338 %t2 = call i32 @foo(i32 %in, i8* %b)
339 call void @llvm.lifetime.end(i64 -1, i8* %b)
340 call void @llvm.lifetime.start(i64 -1, i8* %b)
341 br i1 %d, label %bb2, label %bb3
342 bb2:
343 call void @llvm.lifetime.start(i64 -1, i8* %b2)
344 %t3 = call i32 @foo(i32 %in, i8* %b2)
345 %t4 = call i32 @foo(i32 %in, i8* %b2)
346 %t5 = add i32 %t1, %t2
347 %t6 = add i32 %t3, %t4
348 %t7 = add i32 %t5, %t6
349 ret i32 %t7
350 bb3:
351 ret i32 0
352 }
353
327354 declare void @bar([100 x i32]* , [100 x i32]*) nounwind
328355
329356 declare void @llvm.lifetime.start(i64, i8* nocapture) nounwind