[PATCH] D140495: [TailDuplicator] Pre-commit test case for a subreg composition bug

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 13:19:34 PST 2022


bjope created this revision.
Herald added a project: All.
bjope requested review of this revision.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140495

Files:
  llvm/test/CodeGen/AArch64/taildup-subreg-compose.mir


Index: llvm/test/CodeGen/AArch64/taildup-subreg-compose.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/taildup-subreg-compose.mir
@@ -0,0 +1,68 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=aarch64 -o - -run-pass=early-tailduplication -verify-machineinstrs %s | FileCheck %s
+
+# Reproducer for a problem found with an out-of-tree target. This being
+# an attempt to re-create that for an in-tree target.
+#
+# When tail duplicator is duplicating the $s1 assignment into
+# bb.0 it need to resolve both the subreg access in the PHI
+# and the subreg access in the COPY.
+#
+# So what we expect is to find some thing like
+#   $s1 = COPY %0.dsub_then_ssub
+# with two levels of subreg accesses (possibly composed into one subreg index).
+
+
+---
+name:            foo2
+tracksRegLiveness: true
+body:             |
+  ; CHECK-LABEL: name: foo2
+  ; CHECK: bb.0.entry:
+  ; CHECK-NEXT:   successors: %bb.4(0x80000000)
+  ; CHECK-NEXT:   liveins: $q1
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:fpr128 = COPY $q1
+  ; CHECK-NEXT:   $s1 = COPY [[COPY]].dsub
+  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:fpr64 = COPY [[COPY]].dsub
+  ; CHECK-NEXT:   B %bb.4
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT: bb.1:
+  ; CHECK-NEXT:   successors: %bb.4(0x80000000)
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
+  ; CHECK-NEXT:   $s1 = COPY [[DEF]].dsub
+  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:fpr64 = COPY [[DEF]].dsub
+  ; CHECK-NEXT:   B %bb.4
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT: bb.3:
+  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   B %bb.3
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT: bb.4:
+  ; CHECK-NEXT:   successors: %bb.4(0x80000000)
+  ; CHECK-NEXT: {{  $}}
+  ; CHECK-NEXT:   B %bb.4
+  bb.0.entry:
+    liveins: $q1
+
+    %0:fpr128 = COPY $q1
+    B %bb.2
+
+  bb.1:
+    %1:fpr128 = IMPLICIT_DEF
+    B %bb.2
+
+  bb.2:
+    %2:fpr64 = PHI %0.dsub, %bb.0, %1.dsub, %bb.1
+    $s1 = COPY %2.ssub
+    B %bb.4
+
+  bb.3:
+    B %bb.3
+
+  bb.4:
+    B %bb.4
+...
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140495.484656.patch
Type: text/x-patch
Size: 2180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221221/d27fb091/attachment.bin>


More information about the llvm-commits mailing list