mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Hook up AliasAnalysis in InlineSpiller. This is used for rematerializing
constant loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
954ffff79b
commit
e93198af07
@ -17,6 +17,7 @@
|
||||
#include "LiveRangeEdit.h"
|
||||
#include "SplitKit.h"
|
||||
#include "VirtRegMap.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
|
||||
#include "llvm/CodeGen/LiveStackAnalysis.h"
|
||||
#include "llvm/CodeGen/MachineDominators.h"
|
||||
@ -47,6 +48,7 @@ class InlineSpiller : public Spiller {
|
||||
LiveStacks &lss_;
|
||||
MachineDominatorTree &mdt_;
|
||||
MachineLoopInfo &loops_;
|
||||
AliasAnalysis *aa_;
|
||||
VirtRegMap &vrm_;
|
||||
MachineFrameInfo &mfi_;
|
||||
MachineRegisterInfo &mri_;
|
||||
@ -76,6 +78,7 @@ public:
|
||||
lss_(pass.getAnalysis<LiveStacks>()),
|
||||
mdt_(pass.getAnalysis<MachineDominatorTree>()),
|
||||
loops_(pass.getAnalysis<MachineLoopInfo>()),
|
||||
aa_(&pass.getAnalysis<AliasAnalysis>()),
|
||||
vrm_(vrm),
|
||||
mfi_(*mf.getFrameInfo()),
|
||||
mri_(mf.getRegInfo()),
|
||||
@ -219,7 +222,7 @@ bool InlineSpiller::reMaterializeFor(MachineBasicBlock::iterator MI) {
|
||||
/// and trim the live ranges after.
|
||||
void InlineSpiller::reMaterializeAll() {
|
||||
// Do a quick scan of the interval values to find if any are remattable.
|
||||
if (!edit_->anyRematerializable(lis_, tii_, 0))
|
||||
if (!edit_->anyRematerializable(lis_, tii_, aa_))
|
||||
return;
|
||||
|
||||
usedValues_.clear();
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "VirtRegMap.h"
|
||||
#include "VirtRegRewriter.h"
|
||||
#include "Spiller.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/CodeGen/CalcSpillWeights.h"
|
||||
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
|
||||
@ -193,6 +194,8 @@ namespace {
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesCFG();
|
||||
AU.addRequired<AliasAnalysis>();
|
||||
AU.addPreserved<AliasAnalysis>();
|
||||
AU.addRequired<LiveIntervals>();
|
||||
AU.addPreserved<SlotIndexes>();
|
||||
if (StrongPHIElim)
|
||||
@ -391,6 +394,7 @@ INITIALIZE_PASS_DEPENDENCY(LiveStacks)
|
||||
INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
|
||||
INITIALIZE_PASS_DEPENDENCY(VirtRegMap)
|
||||
INITIALIZE_AG_DEPENDENCY(RegisterCoalescer)
|
||||
INITIALIZE_AG_DEPENDENCY(AliasAnalysis)
|
||||
INITIALIZE_PASS_END(RALinScan, "linearscan-regalloc",
|
||||
"Linear Scan Register Allocator", false, false)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user