diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-11-19 19:31:10 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-11-19 19:31:10 +0000 |
| commit | 31ebe5580835ca852e2bd402a4feb25ae404b7cc (patch) | |
| tree | a59727c201a1f9d1113f271356d97e46d1ab8796 /llvm/lib/CodeGen/LiveInterval.cpp | |
| parent | c6c2b9bfe85cdcfed667ee0036a5d88defdcf918 (diff) | |
| download | bcm5719-llvm-31ebe5580835ca852e2bd402a4feb25ae404b7cc.tar.gz bcm5719-llvm-31ebe5580835ca852e2bd402a4feb25ae404b7cc.zip | |
Handle mixed normal and early-clobber defs on inline asm.
PR14376.
llvm-svn: 168320
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index c3bf2d234c0..8585cbb30de 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -59,8 +59,16 @@ VNInfo *LiveInterval::createDeadDef(SlotIndex Def, return VNI; } if (SlotIndex::isSameInstr(Def, I->start)) { - assert(I->start == Def && "Cannot insert def, already live"); - assert(I->valno->def == Def && "Inconsistent existing value def"); + assert(I->valno->def == I->start && "Inconsistent existing value def"); + + // It is possible to have both normal and early-clobber defs of the same + // register on an instruction. It doesn't make a lot of sense, but it is + // possible to specify in inline assembly. + // + // Just convert everything to early-clobber. + Def = std::min(Def, I->start); + if (Def != I->start) + I->start = I->valno->def = Def; return I->valno; } assert(SlotIndex::isEarlierInstr(Def, I->start) && "Already live at def"); |

