Skip to content

Commit c1db6a6

Browse files
committed
Drop regstate of SELRMux operand.
1 parent 44feae8 commit c1db6a6

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ void SystemZPostRewrite::selectSELRMux(MachineBasicBlock &MBB,
114114
if (Src1Reg == Src2Reg) {
115115
BuildMI(*MBBI->getParent(), MBBI, MBBI->getDebugLoc(),
116116
TII->get(SystemZ::COPY), DestReg)
117-
.addReg(MBBI->getOperand(1).getReg(), getRegState(MBBI->getOperand(1)));
117+
.addReg(MBBI->getOperand(1).getReg(), RegState::Renamable);
118118
MBBI->eraseFromParent();
119119
return;
120120
}

llvm/test/CodeGen/SystemZ/cond-move-10.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# CHECK: name: fun0
66
# CHECK: renamable $r1l = AHIMuxK killed renamable $r1l, -1, implicit-def dead $cc
77
# CHECK-NEXT: CHIMux renamable $r5h, 9, implicit-def $cc
8-
# CHECK-NEXT: $r14h = COPY killed renamable $r1l
8+
# CHECK-NEXT: $r14h = COPY renamable $r1l
99
---
1010
name: fun0
1111
tracksRegLiveness: true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# RUN: llc -o - %s -mtriple=s390x-linux-gnu -mcpu=z15 -start-before=systemz-post-rewrite \
2+
# RUN: -stop-after=machine-cp 2>&1 | FileCheck %s
3+
4+
# The chained SELRMux:es both has two operands with the same register but
5+
# where one of the operands have been marked as undef (resulting from
6+
# early-ifcvt). Check that the resulting COPY after machine-cp is from $r0l
7+
# to $r2l.
8+
9+
# CHECK: name: fun0
10+
# CHECK: $r2l = COPY $r0l
11+
--- |
12+
13+
@Res = global i32 0, align 4
14+
@Z = global i32 0, align 4
15+
define signext i32 @fun0() { ret i32 0 }
16+
...
17+
---
18+
name: fun0
19+
tracksRegLiveness: true
20+
body: |
21+
bb.0:
22+
successors: %bb.1(0x80000000)
23+
24+
renamable $r0l = LRL @Z :: (dereferenceable load (s32) from @Z)
25+
renamable $r1l = LHIMux 1
26+
27+
bb.1:
28+
successors: %bb.1(0x7c000000), %bb.2(0x04000000)
29+
liveins: $r0l, $r1l
30+
31+
CHIMux renamable $r1l, 0, implicit-def $cc
32+
renamable $r2l = SELRMux undef renamable $r0l, renamable $r0l, 14, 6, implicit $cc
33+
renamable $r2l = SELRMux undef renamable $r2l, killed renamable $r2l, 14, 6, implicit $cc
34+
BRC 14, 8, %bb.1, implicit killed $cc
35+
J %bb.2
36+
37+
bb.2:
38+
liveins: $r2l
39+
40+
STRL renamable $r2l, @Res :: (store (s32) into @Res)
41+
renamable $r2d = LGFR killed renamable $r2l
42+
Return implicit $r2d
43+
...

0 commit comments

Comments
 (0)