[llvm] r289456 - [LiveRangeEdit] Add assert string and descriptive comment.
Geoff Berry via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 11:12:41 PST 2016
Author: gberry
Date: Mon Dec 12 13:12:41 2016
New Revision: 289456
URL: http://llvm.org/viewvc/llvm-project?rev=289456&view=rev
Log:
[LiveRangeEdit] Add assert string and descriptive comment.
Modified:
llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=289456&r1=289455&r2=289456&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Mon Dec 12 13:12:41 2016
@@ -273,7 +273,9 @@ void LiveRangeEdit::eliminateDeadDef(Mac
bool isOrigDef = false;
unsigned Dest;
if (VRM && MI->getOperand(0).isReg() && MI->getOperand(0).isDef()) {
- assert(MI->getDesc().getNumDefs() == 1);
+ // It is assumed that callers of eliminateDeadDefs() will never pass in dead
+ // instructions with multiple virtual register defs.
+ assert(MI->getDesc().getNumDefs() == 1 && "Unexpected instruction with multiple defs.");
Dest = MI->getOperand(0).getReg();
unsigned Original = VRM->getOriginal(Dest);
LiveInterval &OrigLI = LIS.getInterval(Original);
More information about the llvm-commits
mailing list