aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristudasan Devadasan <Christudasan.Devadasan@amd.com>2024-11-14 14:11:44 +0530
committerChristudasan Devadasan <Christudasan.Devadasan@amd.com>2024-11-25 10:59:08 +0530
commit90f830fe1e7aabf73ba3b4dd43cf4360dbd28571 (patch)
treee98405000716bc44a287ed3d86740d13d24f72a2
parentff7b42c194e0fa23e6a76f0a33a80c0c3af14e7d (diff)
downloadllvm-users/cdevadas/mi-flag-for-lr-split-insn.zip
llvm-users/cdevadas/mi-flag-for-lr-split-insn.tar.gz
llvm-users/cdevadas/mi-flag-for-lr-split-insn.tar.bz2
[CodeGen] Introduce MI flag for Live Range split instructionsusers/cdevadas/mi-flag-for-lr-split-insn
For some targets, it is required to identify the COPY instruction corresponds to the RA inserted live range split. Adding the new flag `MachineInstr::LRSplit` to serve the purpose.
-rw-r--r--llvm/include/llvm/CodeGen/MachineInstr.h3
-rw-r--r--llvm/lib/CodeGen/SplitKit.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h
index ead6bbe..4545b20 100644
--- a/llvm/include/llvm/CodeGen/MachineInstr.h
+++ b/llvm/include/llvm/CodeGen/MachineInstr.h
@@ -119,7 +119,8 @@ public:
Disjoint = 1 << 19, // Each bit is zero in at least one of the inputs.
NoUSWrap = 1 << 20, // Instruction supports geps
// no unsigned signed wrap.
- SameSign = 1 << 21 // Both operands have the same sign.
+ SameSign = 1 << 21, // Both operands have the same sign.
+ LRSplit = 1 << 22 // Instruction for live range split.
};
private:
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index eb33b93..5042f07 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -533,6 +533,7 @@ SlotIndex SplitEditor::buildSingleSubRegCopy(
| getInternalReadRegState(!FirstCopy), SubIdx)
.addReg(FromReg, 0, SubIdx);
+ CopyMI->setFlag(MachineInstr::LRSplit);
SlotIndexes &Indexes = *LIS.getSlotIndexes();
if (FirstCopy) {
Def = Indexes.insertMachineInstrInMaps(*CopyMI, Late).getRegSlot();
@@ -552,6 +553,7 @@ SlotIndex SplitEditor::buildCopy(Register FromReg, Register ToReg,
// The full vreg is copied.
MachineInstr *CopyMI =
BuildMI(MBB, InsertBefore, DebugLoc(), Desc, ToReg).addReg(FromReg);
+ CopyMI->setFlag(MachineInstr::LRSplit);
return Indexes.insertMachineInstrInMaps(*CopyMI, Late).getRegSlot();
}