[PATCH] D124267: [MachinePipeliner] Fix unscheduled instruction
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 11:35:33 PDT 2022
thopre updated this revision to Diff 424550.
thopre added a comment.
Herald added a subscriber: nemanjai.
Adjust PowerPC testcases
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124267/new/
https://reviews.llvm.org/D124267
Files:
llvm/lib/CodeGen/MachinePipeliner.cpp
llvm/test/CodeGen/PowerPC/sms-phi-3.ll
llvm/test/CodeGen/PowerPC/sms-phi-5.ll
Index: llvm/test/CodeGen/PowerPC/sms-phi-5.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/sms-phi-5.ll
+++ 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 [
Index: llvm/test/CodeGen/PowerPC/sms-phi-3.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/sms-phi-3.ll
+++ 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
Index: llvm/lib/CodeGen/MachinePipeliner.cpp
===================================================================
--- llvm/lib/CodeGen/MachinePipeliner.cpp
+++ 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124267.424550.patch
Type: text/x-patch
Size: 3112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220422/1f923a6c/attachment.bin>
More information about the llvm-commits
mailing list