1*f4a2713aSLionel Sambuc; RUN: llc < %s -verify-coalescing 2*f4a2713aSLionel Sambuc; PR10046 3*f4a2713aSLionel Sambuc; 4*f4a2713aSLionel Sambuc; PHI elimination splits the critical edge from %while.end415 to %if.end427. 5*f4a2713aSLionel Sambuc; This requires updating the BNE-J terminators to a BEQ. The BNE instruction 6*f4a2713aSLionel Sambuc; kills a virtual register, and LiveVariables must be updated with the new kill 7*f4a2713aSLionel Sambuc; instruction. 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuctarget datalayout = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-n32" 10*f4a2713aSLionel Sambuctarget triple = "mips-ellcc-linux" 11*f4a2713aSLionel Sambuc 12*f4a2713aSLionel Sambucdefine i32 @mergesort(i8* %base, i32 %nmemb, i32 %size, i32 (i8*, i8*)* nocapture %cmp) nounwind { 13*f4a2713aSLionel Sambucentry: 14*f4a2713aSLionel Sambuc br i1 undef, label %return, label %if.end13 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambucif.end13: ; preds = %entry 17*f4a2713aSLionel Sambuc br label %while.body 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambucwhile.body: ; preds = %while.body, %if.end13 20*f4a2713aSLionel Sambuc %list1.0482 = phi i8* [ %base, %if.end13 ], [ null, %while.body ] 21*f4a2713aSLionel Sambuc br i1 undef, label %while.end415, label %while.body 22*f4a2713aSLionel Sambuc 23*f4a2713aSLionel Sambucwhile.end415: ; preds = %while.body 24*f4a2713aSLionel Sambuc br i1 undef, label %if.then419, label %if.end427 25*f4a2713aSLionel Sambuc 26*f4a2713aSLionel Sambucif.then419: ; preds = %while.end415 27*f4a2713aSLionel Sambuc %call425 = tail call i8* @memmove(i8* %list1.0482, i8* undef, i32 undef) nounwind 28*f4a2713aSLionel Sambuc br label %if.end427 29*f4a2713aSLionel Sambuc 30*f4a2713aSLionel Sambucif.end427: ; preds = %if.then419, %while.end415 31*f4a2713aSLionel Sambuc %list2.1 = phi i8* [ undef, %if.then419 ], [ %list1.0482, %while.end415 ] 32*f4a2713aSLionel Sambuc tail call void @free(i8* %list2.1) 33*f4a2713aSLionel Sambuc unreachable 34*f4a2713aSLionel Sambuc 35*f4a2713aSLionel Sambucreturn: ; preds = %entry 36*f4a2713aSLionel Sambuc ret i32 -1 37*f4a2713aSLionel Sambuc} 38*f4a2713aSLionel Sambuc 39*f4a2713aSLionel Sambuc 40*f4a2713aSLionel Sambucdeclare i8* @memmove(i8*, i8*, i32) 41*f4a2713aSLionel Sambuc 42*f4a2713aSLionel Sambucdeclare void @free(i8*) 43*f4a2713aSLionel Sambuc 44