|
14 | 14 |
|
15 | 15 | #include "AIEBaseSubtarget.h" |
16 | 16 | #include "AIE.h" |
17 | | -#include "AIE2Subtarget.h" |
18 | 17 | #include "AIEBaseRegisterInfo.h" |
19 | 18 | #include "AIEInterBlockScheduling.h" |
20 | 19 | #include "AIEMachineScheduler.h" |
21 | 20 | #include "AIEMaxLatencyFinder.h" |
22 | 21 | #include "AIERegMemEventTracker.h" |
23 | | -#include "AIESubtarget.h" |
24 | 22 | #include "Utils/AIELoopUtils.h" |
| 23 | +#include "aie1/AIE1Subtarget.h" |
25 | 24 | #include "aie2p/AIE2PSubtarget.h" |
26 | 25 | #include "llvm/CodeGen/MachineInstr.h" |
27 | 26 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
28 | 27 | #include "llvm/CodeGen/ScheduleDAG.h" |
29 | 28 | #include "llvm/CodeGen/ScheduleDAGInstrs.h" |
30 | 29 | #include "llvm/CodeGen/ScheduleDAGMutation.h" |
31 | | -#include "llvm/MC/MCRegisterInfo.h" |
32 | 30 | #include "llvm/Support/Debug.h" |
33 | 31 |
|
34 | 32 | using namespace llvm; |
@@ -149,18 +147,21 @@ void AIEBaseSubtarget::adjustSchedDependency( |
149 | 147 | } |
150 | 148 | } |
151 | 149 |
|
| 150 | +// Note: AIEBaseSubtarget is not derived from TargetSubtargetInfo. |
| 151 | +// It is glued in through multiple inheritance of the AIE classes, so we go down |
| 152 | +// from TargetSubtargetInfo, and then up to AIEBaseSubTarget. |
| 153 | +// Someone should build the base class injection in tablegen. |
152 | 154 | const AIEBaseSubtarget &AIEBaseSubtarget::get(const MachineFunction &MF) { |
153 | 155 | if (MF.getTarget().getTargetTriple().isAIE1()) |
154 | 156 | return static_cast<const AIEBaseSubtarget &>( |
155 | 157 | MF.getSubtarget<AIESubtarget>()); |
156 | | - else if (MF.getTarget().getTargetTriple().isAIE2()) |
| 158 | + if (MF.getTarget().getTargetTriple().isAIE2()) |
157 | 159 | return static_cast<const AIEBaseSubtarget &>( |
158 | 160 | MF.getSubtarget<AIE2Subtarget>()); |
159 | | - else if (MF.getTarget().getTargetTriple().isAIE2P()) |
| 161 | + if (MF.getTarget().getTargetTriple().isAIE2P()) |
160 | 162 | return static_cast<const AIEBaseSubtarget &>( |
161 | 163 | MF.getSubtarget<AIE2PSubtarget>()); |
162 | | - else |
163 | | - llvm_unreachable("Unknown subtarget"); |
| 164 | + llvm_unreachable("Unknown subtarget"); |
164 | 165 | } |
165 | 166 |
|
166 | 167 | namespace { |
|
0 commit comments