llvm.org GIT mirror llvm / 163f67f
Never attempt to join an early-clobber def with a regular kill. This fixes PR14194. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166880 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 7 years ago
2 changed file(s) with 23 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
14901490 // handles this complex value mapping.
14911491 if ((V.WriteLanes & OtherV.ValidLanes) == 0)
14921492 return CR_Replace;
1493
1494 // If the other live range is killed by DefMI and the live ranges are still
1495 // overlapping, it must be because we're looking at an early clobber def:
1496 //
1497 // %dst = ASM %src
1498 //
1499 // In this case, it is illegal to merge the two live ranges since the early
1500 // clobber def would clobber %src before it was read.
1501 if (OtherLRQ.isKill()) {
1502 // This case where the def doesn't overlap the kill is handled above.
1503 assert(VNI->def.isEarlyClobber() &&
1504 "Only early clobber defs can overlap a kill");
1505 return CR_Impossible;
1506 }
14931507
14941508 // VNI is clobbering live lanes in OtherVNI, but there is still the
14951509 // possibility that no instructions actually read the clobbered lanes.
579579 bb29: ; preds = %bb28, %bb26, %bb25, %bb21
580580 unreachable
581581 }
582
583 define void @pr14194() nounwind uwtable {
584 %tmp = load i64* undef, align 16
585 %tmp1 = trunc i64 %tmp to i32
586 %tmp2 = lshr i64 %tmp, 32
587 %tmp3 = trunc i64 %tmp2 to i32
588 %tmp4 = call { i32, i32 } asm sideeffect "", "=&r,=&r,r,r,0,1,~{dirflag},~{fpsr},~{flags}"(i32 %tmp3, i32 undef, i32 %tmp3, i32 %tmp1) nounwind
589 ret void
590 }