diff options
author | Pawel Wodnicki <pawel@32bitmicro.com> | 2012-11-23 20:02:28 +0000 |
---|---|---|
committer | Pawel Wodnicki <pawel@32bitmicro.com> | 2012-11-23 20:02:28 +0000 |
commit | 12c349d44181f8083ee9120ddd3b2664c0a1fe8f (patch) | |
tree | 4a75226da917c102342e00417f3469e33a0be555 /lib | |
parent | 024e48b43d3fbafe24b0205fb8b94015d43ff3a6 (diff) | |
download | llvm-12c349d44181f8083ee9120ddd3b2664c0a1fe8f.tar.gz llvm-12c349d44181f8083ee9120ddd3b2664c0a1fe8f.tar.bz2 llvm-12c349d44181f8083ee9120ddd3b2664c0a1fe8f.tar.xz |
Merging r168320: into 3.2 relase branch.
Handle mixed normal and early-clobber defs on inline asm.
PR14376.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index c3bf2d234c..8585cbb30d 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/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"); |