OLD | NEW |
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the skeleton of the TargetLowering class, | 10 // This file implements the skeleton of the TargetLowering class, |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 RegSetMask RegExclude = RegSet_None; | 245 RegSetMask RegExclude = RegSet_None; |
246 RegInclude |= RegSet_CallerSave; | 246 RegInclude |= RegSet_CallerSave; |
247 RegInclude |= RegSet_CalleeSave; | 247 RegInclude |= RegSet_CalleeSave; |
248 if (hasFramePointer()) | 248 if (hasFramePointer()) |
249 RegExclude |= RegSet_FramePointer; | 249 RegExclude |= RegSet_FramePointer; |
250 LinearScan.init(Kind); | 250 LinearScan.init(Kind); |
251 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude); | 251 llvm::SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude); |
252 LinearScan.scan(RegMask, RandomizeRegisterAllocation); | 252 LinearScan.scan(RegMask, RandomizeRegisterAllocation); |
253 } | 253 } |
254 | 254 |
255 TargetGlobalInitLowering * | 255 TargetGlobalLowering *TargetGlobalLowering::createLowering(GlobalContext *Ctx) { |
256 TargetGlobalInitLowering::createLowering(TargetArch Target, | |
257 GlobalContext *Ctx) { | |
258 // These statements can be #ifdef'd to specialize the code generator | 256 // These statements can be #ifdef'd to specialize the code generator |
259 // to a subset of the available targets. TODO: use CRTP. | 257 // to a subset of the available targets. TODO: use CRTP. |
| 258 TargetArch Target = Ctx->getTargetArch(); |
260 if (Target == Target_X8632) | 259 if (Target == Target_X8632) |
261 return TargetGlobalInitX8632::create(Ctx); | 260 return TargetGlobalX8632::create(Ctx); |
262 #if 0 | 261 #if 0 |
263 if (Target == Target_X8664) | 262 if (Target == Target_X8664) |
264 return IceTargetGlobalInitX8664::create(Ctx); | 263 return TargetGlobalX8664::create(Ctx); |
265 if (Target == Target_ARM32) | 264 if (Target == Target_ARM32) |
266 return IceTargetGlobalInitARM32::create(Ctx); | 265 return TargetGlobalARM32::create(Ctx); |
267 if (Target == Target_ARM64) | 266 if (Target == Target_ARM64) |
268 return IceTargetGlobalInitARM64::create(Ctx); | 267 return TargetGlobalARM64::create(Ctx); |
269 #endif | 268 #endif |
270 llvm_unreachable("Unsupported target"); | 269 llvm_unreachable("Unsupported target"); |
271 return nullptr; | 270 return nullptr; |
272 } | 271 } |
273 | 272 |
274 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} | 273 TargetGlobalLowering::~TargetGlobalLowering() {} |
275 | 274 |
276 } // end of namespace Ice | 275 } // end of namespace Ice |
OLD | NEW |