[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / lib / CodeGen / RegAllocPriorityAdvisor.cpp
blobd6fce43091c603cbc237579059b513237c87709c
1 //===- RegAllocPriorityAdvisor.cpp - live ranges priority advisor ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implementation of the default priority advisor and of the Analysis pass.
11 //===----------------------------------------------------------------------===//
13 #include "RegAllocPriorityAdvisor.h"
14 #include "RegAllocGreedy.h"
15 #include "llvm/CodeGen/MachineFunction.h"
16 #include "llvm/CodeGen/VirtRegMap.h"
17 #include "llvm/InitializePasses.h"
18 #include "llvm/Pass.h"
20 using namespace llvm;
22 RegAllocPriorityAdvisor::RegAllocPriorityAdvisor(const MachineFunction &MF,
23 const RAGreedy &RA)
24 : RA(RA), LIS(RA.getLiveIntervals()), VRM(RA.getVirtRegMap()),
25 MRI(&VRM->getRegInfo()), TRI(MF.getSubtarget().getRegisterInfo()),
26 RegClassInfo(RA.getRegClassInfo()), Indexes(RA.getIndexes()),
27 RegClassPriorityTrumpsGlobalness(
28 RA.getRegClassPriorityTrumpsGlobalness()),
29 ReverseLocalAssignment(RA.getReverseLocalAssignment()) {}