mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Save a mapping between original and cloned constpool entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124570 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -368,6 +368,14 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
if (isThumb && !HasFarJump && AFI->isLRSpilledForFarJump())
|
if (isThumb && !HasFarJump && AFI->isLRSpilledForFarJump())
|
||||||
MadeChange |= UndoLRSpillRestore();
|
MadeChange |= UndoLRSpillRestore();
|
||||||
|
|
||||||
|
// Save the mapping between original and cloned constpool entries.
|
||||||
|
for (unsigned i = 0, e = CPEntries.size(); i != e; ++i) {
|
||||||
|
for (unsigned j = 0, je = CPEntries[i].size(); j != je; ++j) {
|
||||||
|
const CPEntry & CPE = CPEntries[i][j];
|
||||||
|
AFI->recordCPEClone(i, CPE.CPI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG(errs() << '\n'; dumpBBs());
|
DEBUG(errs() << '\n'; dumpBBs());
|
||||||
|
|
||||||
BBSizes.clear();
|
BBSizes.clear();
|
||||||
|
@@ -95,6 +95,10 @@ class ARMFunctionInfo : public MachineFunctionInfo {
|
|||||||
/// HasITBlocks - True if IT blocks have been inserted.
|
/// HasITBlocks - True if IT blocks have been inserted.
|
||||||
bool HasITBlocks;
|
bool HasITBlocks;
|
||||||
|
|
||||||
|
/// CPEClones - Track constant pool entries clones created by Constant Island
|
||||||
|
/// pass.
|
||||||
|
DenseMap<unsigned, unsigned> CPEClones;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ARMFunctionInfo() :
|
ARMFunctionInfo() :
|
||||||
isThumb(false),
|
isThumb(false),
|
||||||
@@ -244,6 +248,19 @@ public:
|
|||||||
|
|
||||||
bool hasITBlocks() const { return HasITBlocks; }
|
bool hasITBlocks() const { return HasITBlocks; }
|
||||||
void setHasITBlocks(bool h) { HasITBlocks = h; }
|
void setHasITBlocks(bool h) { HasITBlocks = h; }
|
||||||
|
|
||||||
|
void recordCPEClone(unsigned CPIdx, unsigned CPCloneIdx) {
|
||||||
|
if (!CPEClones.insert(std::make_pair(CPCloneIdx, CPIdx)).second)
|
||||||
|
assert(0 && "Duplicate entries!");
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned getOriginalCPIdx(unsigned CloneIdx) const {
|
||||||
|
DenseMap<unsigned, unsigned>::const_iterator I = CPEClones.find(CloneIdx);
|
||||||
|
if (I != CPEClones.end())
|
||||||
|
return I->second;
|
||||||
|
else
|
||||||
|
return -1U;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user