diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2022-06-08 13:05:35 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2022-06-08 13:05:35 +0800 |
commit | 7207373e1eb0dd419b4e13a5e2d0ca146ef9544e (patch) | |
tree | 86df6d2bf62fae8736d959fa264de4d2e76208b6 /llvm/lib/CodeGen/SplitKit.cpp | |
parent | 311f7839602344ca347816146edb68c0ffaaa060 (diff) | |
download | llvm-7207373e1eb0dd419b4e13a5e2d0ca146ef9544e.zip llvm-7207373e1eb0dd419b4e13a5e2d0ca146ef9544e.tar.gz llvm-7207373e1eb0dd419b4e13a5e2d0ca146ef9544e.tar.bz2 |
Revert "[SplitKit] Handle early clobber + tied to def correctly"
Revert due to failed on LLVM_ENABLE_EXPENSIVE_CHECKS.
This reverts commit e14d04909df4e52e531f6c2e045c3cf9638dd817.
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index 140a91ae..f270c3a 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -1352,34 +1352,13 @@ void SplitEditor::rewriteAssigned(bool ExtendRanges) { continue; // We may want to extend a live range for a partial redef, or for a use // tied to an early clobber. - if (!Edit->getParent().liveAt(Idx.getPrevSlot())) + Idx = Idx.getPrevSlot(); + if (!Edit->getParent().liveAt(Idx)) continue; - } else { - assert(MO.isUse()); - bool IsEarlyClobber = false; - if (MO.isTied()) { - // We want to extend a live range into `e` slot rather than `r` slot if - // tied-def is early clobber, because the `e` slot already contained - // in the live range of early-clobber tied-def operand, give an example - // here: - // 0 %0 = ... - // 16 early-clobber %0 = Op %0 (tied-def 0), ... - // 32 ... = Op %0 - // Before extend: - // %0 = [0r, 0d) [16e, 32d) - // The point we want to extend is 0d to 16e not 16r in this case, but if - // we use 16r here we will extend nothing because that already contained - // in [16e, 32d). - unsigned OpIdx = MI->getOperandNo(&MO); - unsigned DefOpIdx = MI->findTiedOperandIdx(OpIdx); - const MachineOperand &DefOp = MI->getOperand(DefOpIdx); - IsEarlyClobber = DefOp.isEarlyClobber(); - } - - Idx = Idx.getRegSlot(IsEarlyClobber); - } + } else + Idx = Idx.getRegSlot(true); - SlotIndex Next = Idx; + SlotIndex Next = Idx.getNextSlot(); if (LI.hasSubRanges()) { // We have to delay extending subranges until we have seen all operands // defining the register. This is because a <def,read-undef> operand |