Fix PR4753.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 23 Aug 2009 13:01:45 +0000 (13:01 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sun, 23 Aug 2009 13:01:45 +0000 (13:01 +0000)
commit46ff969ca6e42e354c29328877810b0f7f373af0
treeb44280d8575ca4e2000c5e88360d3d872995799b
parent072a56e37de0e4872ce0340b0bd5585ba15fd0c3
Fix PR4753.

When undoing a reuse in ReuseInfo::GetRegForReload, check if it was only a
sub-register being used. The MachineOperand::getSubReg() method is only valid
for virtual registers, so we have to recover the sub-register index manually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79855 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/VirtRegRewriter.cpp
test/CodeGen/X86/2009-08-23-SubRegReuseUndo.ll [new file with mode: 0644]