AMDGPU/SI: Add implicit register operands in the correct order.
authorAlex Lorenz <arphaman@gmail.com>
Fri, 31 Jul 2015 23:30:09 +0000 (23:30 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 31 Jul 2015 23:30:09 +0000 (23:30 +0000)
commitf5cf675376b10187372c33084b3d33de31ebf484
tree9caa49992319ee5deb0b14e7f0953f9d8564b322
parentc198b23a4d8b773bcbe61d0a6502cb213e682e51
AMDGPU/SI: Add implicit register operands in the correct order.

This commit fixes a bug in the class 'SIInstrInfo' where the implicit register
machine operands were added to a machine instruction in an incorrect order -
the implicit uses were added before the implicit defs.

I found this bug while working on moving the implicit register operand
verification code from the MIR parser to the machine verifier.

This commit also makes the method 'addImplicitDefUseOperands' in the machine
instruction class public so that it can be reused in the 'SIInstrInfo' class.

Reviewers: Matt Arsenault

Differential Revision: http://reviews.llvm.org/D11689

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243799 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineInstr.h
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstrInfo.h
test/CodeGen/AMDGPU/si-instr-info-correct-implicit-operands.ll [new file with mode: 0644]