1 //===- RegAllocPriorityAdvisor.cpp - live ranges priority advisor ---------===//
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
7 //===----------------------------------------------------------------------===//
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"
22 RegAllocPriorityAdvisor::RegAllocPriorityAdvisor(const MachineFunction
&MF
,
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()) {}