diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -1575,9 +1575,11 @@ return Path.contains(Cur); bool FoundPath = false; for (auto &SI : Cur->Succs) - FoundPath |= computePath(SI.getSUnit(), Path, DestNodes, Exclude, Visited); + if (!ignoreDependence(SI, false)) + FoundPath |= + computePath(SI.getSUnit(), Path, DestNodes, Exclude, Visited); for (auto &PI : Cur->Preds) - if (PI.getKind() == SDep::Anti) + if (PI.getKind() == SDep::Anti && !ignoreDependence(PI, true)) FoundPath |= computePath(PI.getSUnit(), Path, DestNodes, Exclude, Visited); if (FoundPath) diff --git a/llvm/test/CodeGen/PowerPC/sms-phi-3.ll b/llvm/test/CodeGen/PowerPC/sms-phi-3.ll --- a/llvm/test/CodeGen/PowerPC/sms-phi-3.ll +++ b/llvm/test/CodeGen/PowerPC/sms-phi-3.ll @@ -19,39 +19,19 @@ ; CHECK-NEXT: mr 29, 3 ; CHECK-NEXT: bl malloc ; CHECK-NEXT: nop -; CHECK-NEXT: addi 7, 30, -4 ; CHECK-NEXT: mtctr 3 ; CHECK-NEXT: addi 4, 29, -8 -; CHECK-NEXT: li 5, 0 -; CHECK-NEXT: lwzu 8, 4(7) -; CHECK-NEXT: bdz .LBB0_5 -; CHECK-NEXT: # %bb.1: -; CHECK-NEXT: extswsli 6, 5, 5 -; CHECK-NEXT: add 5, 8, 5 -; CHECK-NEXT: lwzu 8, 4(7) -; CHECK-NEXT: bdz .LBB0_4 -; CHECK-NEXT: # %bb.2: -; CHECK-NEXT: add 6, 3, 6 -; CHECK-NEXT: stdu 6, 8(4) -; CHECK-NEXT: extswsli 6, 5, 5 -; CHECK-NEXT: add 5, 8, 5 -; CHECK-NEXT: lwzu 8, 4(7) -; CHECK-NEXT: bdz .LBB0_4 +; CHECK-NEXT: addi 5, 30, -4 +; CHECK-NEXT: li 6, 0 ; CHECK-NEXT: .p2align 5 -; CHECK-NEXT: .LBB0_3: # -; CHECK-NEXT: add 9, 3, 6 -; CHECK-NEXT: extswsli 6, 5, 5 -; CHECK-NEXT: add 5, 8, 5 -; CHECK-NEXT: lwzu 8, 4(7) -; CHECK-NEXT: stdu 9, 8(4) -; CHECK-NEXT: bdnz .LBB0_3 -; CHECK-NEXT: .LBB0_4: -; CHECK-NEXT: add 6, 3, 6 -; CHECK-NEXT: stdu 6, 8(4) -; CHECK-NEXT: .LBB0_5: -; CHECK-NEXT: extswsli 5, 5, 5 -; CHECK-NEXT: add 3, 3, 5 -; CHECK-NEXT: stdu 3, 8(4) +; CHECK-NEXT: .LBB0_1: +; CHECK-NEXT: lwzu 7, 4(5) +; CHECK-NEXT: extswsli 8, 6, 5 +; CHECK-NEXT: add 8, 3, 8 +; CHECK-NEXT: add 6, 7, 6 +; CHECK-NEXT: stdu 8, 8(4) +; CHECK-NEXT: bdnz .LBB0_1 +; CHECK-NEXT: # %bb.2: ; CHECK-NEXT: addi 1, 1, 64 ; CHECK-NEXT: ld 0, 16(1) ; CHECK-NEXT: ld 30, -16(1) # 8-byte Folded Reload diff --git a/llvm/test/CodeGen/PowerPC/sms-phi-5.ll b/llvm/test/CodeGen/PowerPC/sms-phi-5.ll --- a/llvm/test/CodeGen/PowerPC/sms-phi-5.ll +++ b/llvm/test/CodeGen/PowerPC/sms-phi-5.ll @@ -14,10 +14,12 @@ ; CHECK-NEXT: # %bb.2: ; CHECK-NEXT: lhz 3, 0(3) ; CHECK-NEXT: slwi 3, 3, 15 +; CHECK-NEXT: rlwinm 4, 3, 31, 17, 31 +; CHECK-NEXT: or 3, 3, 4 +; CHECK-NEXT: slwi 3, 3, 15 ; CHECK-NEXT: clrlwi 3, 3, 31 ; CHECK-NEXT: rlwinm 4, 3, 31, 17, 31 ; CHECK-NEXT: or 3, 3, 4 -; CHECK-NEXT: rlwimi 3, 3, 15, 0, 16 ; CHECK-NEXT: # %bb.3: ; CHECK-NEXT: blr switch i12 undef, label %21 [