It seems that there can be other cases with this that also can lead to wrong code (discovered with csmith). This time it involved not the kill flag but the undef flag. Use the intersection of the flags from both MachineOperand:s instead of the RegState from just one of them.
22 lines
813 B
YAML
22 lines
813 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 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
|
|
...
|