Files
clang-p2996/llvm/test/CodeGen/SystemZ/cond-move-10.mir
Jonas Paulsson eb1a571114 [SystemZ] Replace SELRMux with COPY in case of identical operands. (#125108)
If both operands of a SELRMux use the same register which is killed, and
the SELRMux is expanded to a jump sequence, a broken MIR results if the
kill flag is not removed. 

This patch replaces the SELRMux with a COPY in these cases.
2025-01-31 13:58:01 +01:00

22 lines
820 B
YAML

# RUN: llc -o - %s -mtriple=s390x-linux-gnu -mcpu=z15 -run-pass=systemz-post-rewrite \
# RUN: 2>&1 | FileCheck %s
# The SELRMux has two identical sources - replace with a copy instruction.
# CHECK: name: fun0
# CHECK: renamable $r1l = AHIMuxK killed renamable $r1l, -1, implicit-def dead $cc
# CHECK-NEXT: CHIMux renamable $r5h, 9, implicit-def $cc
# CHECK-NEXT: $r14h = COPY killed renamable $r1l
---
name: fun0
tracksRegLiveness: true
body: |
bb.0:
liveins: $r1l, $r5h
renamable $r1l = AHIMuxK killed renamable $r1l, -1, implicit-def dead $cc
CHIMux renamable $r5h, 9, implicit-def $cc
renamable $r14h = SELRMux killed renamable $r1l, renamable $r1l, 14, 8, implicit $cc
$r14l = COPY killed renamable $r14h
$r14d = LGFR $r14l
Return implicit $r14d
...