Skip to content

Commit 2105da7

Browse files
committed
Revert "[PHIElimination] Reuse existing COPY in predecessor basic block (llvm#131837)"
hangs hipCatch2 tests This reverts commit f5c62ee.
1 parent ff7c5c8 commit 2105da7

File tree

143 files changed

+51209
-49314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+51209
-49314
lines changed

llvm/lib/CodeGen/PHIElimination.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -581,15 +581,6 @@ void PHIEliminationImpl::LowerPHINode(MachineBasicBlock &MBB,
581581
continue;
582582
}
583583

584-
// Reuse an existing copy in the block if possible.
585-
if (MachineInstr *DefMI = MRI->getUniqueVRegDef(SrcReg)) {
586-
if (DefMI->isCopy() && DefMI->getParent() == &opBlock &&
587-
MRI->use_empty(SrcReg)) {
588-
DefMI->getOperand(0).setReg(IncomingReg);
589-
continue;
590-
}
591-
}
592-
593584
// Find a safe location to insert the copy, this may be the first terminator
594585
// in the block (or end()).
595586
MachineBasicBlock::iterator InsertPos =

llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-outline_atomics.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ define dso_local void @store_atomic_i64_aligned_seq_cst(i64 %value, ptr %ptr) {
118118
define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) {
119119
; -O0-LABEL: store_atomic_i128_aligned_unordered:
120120
; -O0: bl __aarch64_cas16_relax
121-
; -O0: subs x9, x0, x9
122-
; -O0: ccmp x1, x8, #0, eq
121+
; -O0: subs x10, x10, x11
122+
; -O0: ccmp x8, x9, #0, eq
123123
;
124124
; -O1-LABEL: store_atomic_i128_aligned_unordered:
125125
; -O1: ldxp xzr, x8, [x2]
@@ -131,8 +131,8 @@ define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr
131131
define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
132132
; -O0-LABEL: store_atomic_i128_aligned_monotonic:
133133
; -O0: bl __aarch64_cas16_relax
134-
; -O0: subs x9, x0, x9
135-
; -O0: ccmp x1, x8, #0, eq
134+
; -O0: subs x10, x10, x11
135+
; -O0: ccmp x8, x9, #0, eq
136136
;
137137
; -O1-LABEL: store_atomic_i128_aligned_monotonic:
138138
; -O1: ldxp xzr, x8, [x2]
@@ -144,8 +144,8 @@ define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr
144144
define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
145145
; -O0-LABEL: store_atomic_i128_aligned_release:
146146
; -O0: bl __aarch64_cas16_rel
147-
; -O0: subs x9, x0, x9
148-
; -O0: ccmp x1, x8, #0, eq
147+
; -O0: subs x10, x10, x11
148+
; -O0: ccmp x8, x9, #0, eq
149149
;
150150
; -O1-LABEL: store_atomic_i128_aligned_release:
151151
; -O1: ldxp xzr, x8, [x2]
@@ -157,8 +157,8 @@ define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr)
157157
define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
158158
; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
159159
; -O0: bl __aarch64_cas16_acq_rel
160-
; -O0: subs x9, x0, x9
161-
; -O0: ccmp x1, x8, #0, eq
160+
; -O0: subs x10, x10, x11
161+
; -O0: ccmp x8, x9, #0, eq
162162
;
163163
; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
164164
; -O1: ldaxp xzr, x8, [x2]

llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-rcpc.ll

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ define dso_local void @store_atomic_i64_aligned_seq_cst(i64 %value, ptr %ptr) {
117117

118118
define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) {
119119
; -O0-LABEL: store_atomic_i128_aligned_unordered:
120-
; -O0: ldxp x8, x10, [x13]
121-
; -O0: cmp x8, x9
120+
; -O0: ldxp x10, x12, [x9]
122121
; -O0: cmp x10, x11
123-
; -O0: stxp w12, x14, x15, [x13]
124-
; -O0: stxp w12, x8, x10, [x13]
125-
; -O0: subs x10, x10, x11
126-
; -O0: ccmp x8, x9, #0, eq
122+
; -O0: cmp x12, x13
123+
; -O0: stxp w8, x14, x15, [x9]
124+
; -O0: stxp w8, x10, x12, [x9]
125+
; -O0: subs x12, x12, x13
126+
; -O0: ccmp x10, x11, #0, eq
127127
;
128128
; -O1-LABEL: store_atomic_i128_aligned_unordered:
129129
; -O1: ldxp xzr, x8, [x2]
@@ -134,13 +134,13 @@ define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr
134134

135135
define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
136136
; -O0-LABEL: store_atomic_i128_aligned_monotonic:
137-
; -O0: ldxp x8, x10, [x13]
138-
; -O0: cmp x8, x9
137+
; -O0: ldxp x10, x12, [x9]
139138
; -O0: cmp x10, x11
140-
; -O0: stxp w12, x14, x15, [x13]
141-
; -O0: stxp w12, x8, x10, [x13]
142-
; -O0: subs x10, x10, x11
143-
; -O0: ccmp x8, x9, #0, eq
139+
; -O0: cmp x12, x13
140+
; -O0: stxp w8, x14, x15, [x9]
141+
; -O0: stxp w8, x10, x12, [x9]
142+
; -O0: subs x12, x12, x13
143+
; -O0: ccmp x10, x11, #0, eq
144144
;
145145
; -O1-LABEL: store_atomic_i128_aligned_monotonic:
146146
; -O1: ldxp xzr, x8, [x2]
@@ -151,13 +151,13 @@ define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr
151151

152152
define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
153153
; -O0-LABEL: store_atomic_i128_aligned_release:
154-
; -O0: ldxp x8, x10, [x13]
155-
; -O0: cmp x8, x9
154+
; -O0: ldxp x10, x12, [x9]
156155
; -O0: cmp x10, x11
157-
; -O0: stlxp w12, x14, x15, [x13]
158-
; -O0: stlxp w12, x8, x10, [x13]
159-
; -O0: subs x10, x10, x11
160-
; -O0: ccmp x8, x9, #0, eq
156+
; -O0: cmp x12, x13
157+
; -O0: stlxp w8, x14, x15, [x9]
158+
; -O0: stlxp w8, x10, x12, [x9]
159+
; -O0: subs x12, x12, x13
160+
; -O0: ccmp x10, x11, #0, eq
161161
;
162162
; -O1-LABEL: store_atomic_i128_aligned_release:
163163
; -O1: ldxp xzr, x8, [x2]
@@ -168,13 +168,13 @@ define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr)
168168

169169
define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
170170
; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
171-
; -O0: ldaxp x8, x10, [x13]
172-
; -O0: cmp x8, x9
171+
; -O0: ldaxp x10, x12, [x9]
173172
; -O0: cmp x10, x11
174-
; -O0: stlxp w12, x14, x15, [x13]
175-
; -O0: stlxp w12, x8, x10, [x13]
176-
; -O0: subs x10, x10, x11
177-
; -O0: ccmp x8, x9, #0, eq
173+
; -O0: cmp x12, x13
174+
; -O0: stlxp w8, x14, x15, [x9]
175+
; -O0: stlxp w8, x10, x12, [x9]
176+
; -O0: subs x12, x12, x13
177+
; -O0: ccmp x10, x11, #0, eq
178178
;
179179
; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
180180
; -O1: ldaxp xzr, x8, [x2]

llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-v8a.ll

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ define dso_local void @store_atomic_i64_aligned_seq_cst(i64 %value, ptr %ptr) {
117117

118118
define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) {
119119
; -O0-LABEL: store_atomic_i128_aligned_unordered:
120-
; -O0: ldxp x8, x10, [x13]
121-
; -O0: cmp x8, x9
120+
; -O0: ldxp x10, x12, [x9]
122121
; -O0: cmp x10, x11
123-
; -O0: stxp w12, x14, x15, [x13]
124-
; -O0: stxp w12, x8, x10, [x13]
125-
; -O0: subs x10, x10, x11
126-
; -O0: ccmp x8, x9, #0, eq
122+
; -O0: cmp x12, x13
123+
; -O0: stxp w8, x14, x15, [x9]
124+
; -O0: stxp w8, x10, x12, [x9]
125+
; -O0: subs x12, x12, x13
126+
; -O0: ccmp x10, x11, #0, eq
127127
;
128128
; -O1-LABEL: store_atomic_i128_aligned_unordered:
129129
; -O1: ldxp xzr, x8, [x2]
@@ -134,13 +134,13 @@ define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr
134134

135135
define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
136136
; -O0-LABEL: store_atomic_i128_aligned_monotonic:
137-
; -O0: ldxp x8, x10, [x13]
138-
; -O0: cmp x8, x9
137+
; -O0: ldxp x10, x12, [x9]
139138
; -O0: cmp x10, x11
140-
; -O0: stxp w12, x14, x15, [x13]
141-
; -O0: stxp w12, x8, x10, [x13]
142-
; -O0: subs x10, x10, x11
143-
; -O0: ccmp x8, x9, #0, eq
139+
; -O0: cmp x12, x13
140+
; -O0: stxp w8, x14, x15, [x9]
141+
; -O0: stxp w8, x10, x12, [x9]
142+
; -O0: subs x12, x12, x13
143+
; -O0: ccmp x10, x11, #0, eq
144144
;
145145
; -O1-LABEL: store_atomic_i128_aligned_monotonic:
146146
; -O1: ldxp xzr, x8, [x2]
@@ -151,13 +151,13 @@ define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr
151151

152152
define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
153153
; -O0-LABEL: store_atomic_i128_aligned_release:
154-
; -O0: ldxp x8, x10, [x13]
155-
; -O0: cmp x8, x9
154+
; -O0: ldxp x10, x12, [x9]
156155
; -O0: cmp x10, x11
157-
; -O0: stlxp w12, x14, x15, [x13]
158-
; -O0: stlxp w12, x8, x10, [x13]
159-
; -O0: subs x10, x10, x11
160-
; -O0: ccmp x8, x9, #0, eq
156+
; -O0: cmp x12, x13
157+
; -O0: stlxp w8, x14, x15, [x9]
158+
; -O0: stlxp w8, x10, x12, [x9]
159+
; -O0: subs x12, x12, x13
160+
; -O0: ccmp x10, x11, #0, eq
161161
;
162162
; -O1-LABEL: store_atomic_i128_aligned_release:
163163
; -O1: ldxp xzr, x8, [x2]
@@ -168,13 +168,13 @@ define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr)
168168

169169
define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
170170
; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
171-
; -O0: ldaxp x8, x10, [x13]
172-
; -O0: cmp x8, x9
171+
; -O0: ldaxp x10, x12, [x9]
173172
; -O0: cmp x10, x11
174-
; -O0: stlxp w12, x14, x15, [x13]
175-
; -O0: stlxp w12, x8, x10, [x13]
176-
; -O0: subs x10, x10, x11
177-
; -O0: ccmp x8, x9, #0, eq
173+
; -O0: cmp x12, x13
174+
; -O0: stlxp w8, x14, x15, [x9]
175+
; -O0: stlxp w8, x10, x12, [x9]
176+
; -O0: subs x12, x12, x13
177+
; -O0: ccmp x10, x11, #0, eq
178178
;
179179
; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
180180
; -O1: ldaxp xzr, x8, [x2]

llvm/test/CodeGen/AArch64/PHIElimination-debugloc.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ body: |
3737
bb.1:
3838
%x:gpr32 = COPY $wzr
3939
; Test that the debug location is not copied into bb1!
40-
; CHECK: %3:gpr32 = COPY $wzr
40+
; CHECK: %3:gpr32 = COPY killed %x{{$}}
4141
; CHECK-LABEL: bb.2:
4242
bb.2:
4343
%y:gpr32 = PHI %x:gpr32, %bb.1, undef %undef:gpr32, %bb.0, debug-location !14

llvm/test/CodeGen/AArch64/PHIElimination-reuse-copy.mir

Lines changed: 0 additions & 68 deletions
This file was deleted.

llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ define i16 @red_mla_dup_ext_u8_s8_s16(ptr noalias nocapture noundef readonly %A,
583583
; CHECK-SD-NEXT: mov w10, w2
584584
; CHECK-SD-NEXT: b.hi .LBB5_4
585585
; CHECK-SD-NEXT: // %bb.2:
586-
; CHECK-SD-NEXT: mov w8, wzr
587586
; CHECK-SD-NEXT: mov x11, xzr
587+
; CHECK-SD-NEXT: mov w8, wzr
588588
; CHECK-SD-NEXT: b .LBB5_7
589589
; CHECK-SD-NEXT: .LBB5_3:
590590
; CHECK-SD-NEXT: mov w8, wzr

0 commit comments

Comments
 (0)