summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-22 21:17:55 +0000
committerChris Lattner <sabre@nondot.org>2010-07-22 21:17:55 +0000
commit8f3adc9057dc482ced6a39c4e34f55f883d55262 (patch)
treeb292c89d4ca26732cef62857001534eba579e9af /llvm/lib
parentdab6888bb1339dd6d259202223c93c0433223f58 (diff)
downloadbcm5719-llvm-8f3adc9057dc482ced6a39c4e34f55f883d55262.tar.gz
bcm5719-llvm-8f3adc9057dc482ced6a39c4e34f55f883d55262.zip
remove the JIT "NeedsExactSize" feature and supporting logic.
llvm-svn: 109167
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfoImpl.cpp13
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp61
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.cpp5
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.h4
4 files changed, 3 insertions, 80 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp b/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp
index cdacb98e0e8..6e4a0d837ec 100644
--- a/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp
@@ -178,19 +178,6 @@ MachineInstr *TargetInstrInfoImpl::duplicate(MachineInstr *Orig,
return MF.CloneMachineInstr(Orig);
}
-unsigned
-TargetInstrInfoImpl::GetFunctionSizeInBytes(const MachineFunction &MF) const {
- unsigned FnSize = 0;
- for (MachineFunction::const_iterator MBBI = MF.begin(), E = MF.end();
- MBBI != E; ++MBBI) {
- const MachineBasicBlock &MBB = *MBBI;
- for (MachineBasicBlock::const_iterator I = MBB.begin(),E = MBB.end();
- I != E; ++I)
- FnSize += GetInstSizeInBytes(I);
- }
- return FnSize;
-}
-
// If the COPY instruction in MI can be folded to a stack operation, return
// the register class to use.
static const TargetRegisterClass *canFoldCopy(const MachineInstr *MI,
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 28d79daed35..2c95ff3117f 100644
--- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -831,7 +831,7 @@ void JITEmitter::processDebugLoc(DebugLoc DL, bool BeforePrintingInsn) {
if (DL.isUnknown()) return;
if (!BeforePrintingInsn) return;
- const LLVMContext& Context = EmissionDetails.MF->getFunction()->getContext();
+ const LLVMContext &Context = EmissionDetails.MF->getFunction()->getContext();
if (DL.getScope(Context) != 0 && PrevDL != DL) {
JITEvent_EmittedFunctionDetails::LineStart NextLine;
@@ -859,23 +859,6 @@ static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP,
return Size;
}
-static unsigned GetJumpTableSizeInBytes(MachineJumpTableInfo *MJTI, JIT *jit) {
- const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
- if (JT.empty()) return 0;
-
- unsigned NumEntries = 0;
- for (unsigned i = 0, e = JT.size(); i != e; ++i)
- NumEntries += JT[i].MBBs.size();
-
- return NumEntries * MJTI->getEntrySize(*jit->getTargetData());
-}
-
-static uintptr_t RoundUpToAlign(uintptr_t Size, unsigned Alignment) {
- if (Alignment == 0) Alignment = 1;
- // Since we do not know where the buffer will be allocated, be pessimistic.
- return Size + Alignment;
-}
-
/// addSizeOfGlobal - add the size of the global (plus any alignment padding)
/// into the running total Size.
@@ -1044,43 +1027,8 @@ void JITEmitter::startFunction(MachineFunction &F) {
uintptr_t ActualSize = 0;
// Set the memory writable, if it's not already
MemMgr->setMemoryWritable();
- if (MemMgr->NeedsExactSize()) {
- DEBUG(dbgs() << "JIT: ExactSize\n");
- const TargetInstrInfo* TII = F.getTarget().getInstrInfo();
- MachineConstantPool *MCP = F.getConstantPool();
-
- // Ensure the constant pool/jump table info is at least 4-byte aligned.
- ActualSize = RoundUpToAlign(ActualSize, 16);
-
- // Add the alignment of the constant pool
- ActualSize = RoundUpToAlign(ActualSize, MCP->getConstantPoolAlignment());
-
- // Add the constant pool size
- ActualSize += GetConstantPoolSizeInBytes(MCP, TheJIT->getTargetData());
-
- if (MachineJumpTableInfo *MJTI = F.getJumpTableInfo()) {
- // Add the aligment of the jump table info
- ActualSize = RoundUpToAlign(ActualSize,
- MJTI->getEntryAlignment(*TheJIT->getTargetData()));
-
- // Add the jump table size
- ActualSize += GetJumpTableSizeInBytes(MJTI, TheJIT);
- }
-
- // Add the alignment for the function
- ActualSize = RoundUpToAlign(ActualSize,
- std::max(F.getFunction()->getAlignment(), 8U));
-
- // Add the function size
- ActualSize += TII->GetFunctionSizeInBytes(F);
-
- DEBUG(dbgs() << "JIT: ActualSize before globals " << ActualSize << "\n");
- // Add the size of the globals that will be allocated after this function.
- // These are all the ones referenced from this function that were not
- // previously allocated.
- ActualSize += GetSizeOfGlobalsInBytes(F);
- DEBUG(dbgs() << "JIT: ActualSize after globals " << ActualSize << "\n");
- } else if (SizeEstimate > 0) {
+
+ if (SizeEstimate > 0) {
// SizeEstimate will be non-zero on reallocation attempts.
ActualSize = SizeEstimate;
}
@@ -1268,9 +1216,6 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
SavedBufferEnd = BufferEnd;
SavedCurBufferPtr = CurBufferPtr;
- if (MemMgr->NeedsExactSize())
- ActualSize = DE->GetDwarfTableSizeInBytes(F, *this, FnStart, FnEnd);
-
BufferBegin = CurBufferPtr = MemMgr->startExceptionTable(F.getFunction(),
ActualSize);
BufferEnd = BufferBegin+ActualSize;
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index d170b606ee4..61266227db2 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2945,11 +2945,6 @@ bool X86InstrInfo::isX86_64ExtendedReg(unsigned RegNo) {
return false;
}
-unsigned X86InstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const {
- assert(0 && "X86InstrInfo::GetInstSizeInBytes isn't implemented");
- abort();
-}
-
/// getGlobalBaseReg - Return a virtual register initialized with the
/// the global base register value. Output instructions required to
/// initialize the register in the function entry block, if necessary.
diff --git a/llvm/lib/Target/X86/X86InstrInfo.h b/llvm/lib/Target/X86/X86InstrInfo.h
index ecd3261eedc..8c68bc68053 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.h
+++ b/llvm/lib/Target/X86/X86InstrInfo.h
@@ -825,10 +825,6 @@ public:
/// higher) register? e.g. r8, xmm8, xmm13, etc.
static bool isX86_64ExtendedReg(unsigned RegNo);
- /// GetInstSize - Returns the size of the specified MachineInstr.
- ///
- virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const;
-
/// getGlobalBaseReg - Return a virtual register initialized with the
/// the global base register value. Output instructions required to
/// initialize the register in the function entry block, if necessary.
OpenPOWER on IntegriCloud