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:
parent
e75e60eab8
commit
07dbfddbd4
@ -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;
|
||||
}
|
||||
|
11
test/CodeGen/X86/expand-post-ra-pseudo.mir
Normal file
11
test/CodeGen/X86/expand-post-ra-pseudo.mir
Normal 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
|
||||
...
|
Loading…
Reference in New Issue
Block a user