1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

ExpandPostRAPseudos: Fix alldefsAreDead() not removing operands

One case left around nonsensical operands for the KILL instruction
which the machine verifier checks for nowadays. While this should not
hurt in release builds we should fix the machine verifier errors anyway.

llvm-svn: 344008
This commit is contained in:
Matthias Braun 2018-10-09 00:07:34 +00:00
parent e75e60eab8
commit 07dbfddbd4
2 changed files with 13 additions and 0 deletions

View File

@ -97,6 +97,8 @@ bool ExpandPostRA::LowerSubregToReg(MachineInstr *MI) {
if (MI->allDefsAreDead()) {
MI->setDesc(TII->get(TargetOpcode::KILL));
MI->RemoveOperand(3); // SubIdx
MI->RemoveOperand(1); // Imm
LLVM_DEBUG(dbgs() << "subreg: replaced by: " << *MI);
return true;
}

View File

@ -0,0 +1,11 @@
# RUN: llc -o - %s -mtriple=x86_64-- -run-pass=postrapseudos | FileCheck %s
---
# CHECK-LABEL: name: func
name: func
body: |
bb.0:
liveins: $eax
; CHECK-NOT: dead $rax = KILL {{[0-9]+}}
; CHECK: dead $rax = KILL killed $eax
dead $rax = SUBREG_TO_REG 0, killed $eax, %subreg.sub_32bit
...