mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
RegAlloc: Fix verifier error with undef identity copies
The code did not match the example in the comment, and was checking the undef flag on the copy dest instead of source. The existing tests were only hitting the > 2 operands case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -384,7 +384,7 @@ void VirtRegRewriter::handleIdentityCopy(MachineInstr &MI) const {
|
||||
// give us additional liveness information: The target (super-)register
|
||||
// must not be valid before this point. Replace the COPY with a KILL
|
||||
// instruction to maintain this information.
|
||||
if (MI.getOperand(0).isUndef() || MI.getNumOperands() > 2) {
|
||||
if (MI.getOperand(1).isUndef() || MI.getNumOperands() > 2) {
|
||||
MI.setDesc(TII->get(TargetOpcode::KILL));
|
||||
LLVM_DEBUG(dbgs() << " replace by: " << MI);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user