diff options
author | Dan Gohman <gohman@apple.com> | 2007-06-14 20:50:44 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-06-14 20:50:44 +0000 |
commit | 4a4a8eb00e29e32d72dfa9489aade215a349a06d (patch) | |
tree | 2d564cf84eb227232186dd60a1041c0a3dbbdfe8 /llvm/lib/CodeGen | |
parent | 1e6f08b2a2fb83de83b09214e6f18c1fa1bf1f80 (diff) | |
download | bcm5719-llvm-4a4a8eb00e29e32d72dfa9489aade215a349a06d.tar.gz bcm5719-llvm-4a4a8eb00e29e32d72dfa9489aade215a349a06d.zip |
Add a target hook to allow loads from constant pools to be rematerialized, and an
implementation for x86.
llvm-svn: 37576
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index eadd47b009b..aae27bb882d 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -336,12 +336,14 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb, // time we see a vreg. if (interval.empty()) { // Remember if the definition can be rematerialized. All load's from fixed - // stack slots are re-materializable. + // stack slots are re-materializable. The target may permit other loads to + // be re-materialized as well. int FrameIdx = 0; if (vi.DefInst && (tii_->isReMaterializable(vi.DefInst->getOpcode()) || (tii_->isLoadFromStackSlot(vi.DefInst, FrameIdx) && - mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)))) + mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)) || + tii_->isOtherReMaterializableLoad(vi.DefInst))) interval.remat = vi.DefInst; // Get the Idx of the defining instructions. diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index 9ae38ac9013..95453b0e3d5 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -664,7 +664,8 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM, // If this instruction is being rematerialized, just remove it! int FrameIdx; if ((TID->Flags & M_REMATERIALIZIBLE) || - TII->isLoadFromStackSlot(&MI, FrameIdx)) { + TII->isLoadFromStackSlot(&MI, FrameIdx) || + TII->isOtherReMaterializableLoad(&MI)) { bool Remove = true; for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { MachineOperand &MO = MI.getOperand(i); |