diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-05-20 14:09:36 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-05-20 14:09:36 +0000 |
commit | 7c8ec1896470f2010a0b78c546d303def912aa1e (patch) | |
tree | 2f85f31cf25f0cc8938cef21940f402261930de3 /llvm/lib/CodeGen/VirtRegMap.cpp | |
parent | 3e1821bf4387823bb5df367bce23f9f61e8911fb (diff) | |
download | bcm5719-llvm-7c8ec1896470f2010a0b78c546d303def912aa1e.tar.gz bcm5719-llvm-7c8ec1896470f2010a0b78c546d303def912aa1e.zip |
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.
llvm-svn: 361156
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index d7f21399826..4a06704a887 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -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; |