OSDN Git Service

Fix MachineInstr::findRegisterUseOperandIdx subreg checks
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 12 Nov 2018 18:12:28 +0000 (18:12 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 12 Nov 2018 18:12:28 +0000 (18:12 +0000)
commit1c82b7de9d2f65df559436a19e284d07edc1b01b
tree877f13fda2aef53894993a64937aee7609e1ab9f
parent6856bcc93ce9bc859918a650649db170ab7bbbe0
Fix MachineInstr::findRegisterUseOperandIdx subreg checks

The function only checks that instruction reads a super-register
containing requested physical register. In case if a sub-register
if being read that is also a use of a super-reg, so added the check.
In particular MI->readsRegister() is broken because of the missing
check. The resulting check is essentially regsOverlap().

Differential Revision: https://reviews.llvm.org/D54128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346686 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineInstr.cpp
test/CodeGen/AMDGPU/optimize-if-exec-masking.mir