OLD | NEW |
1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph 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 Cfg class, including constant pool | 10 // This file implements the Cfg class, including constant pool |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 << "\n\n"; | 307 << "\n\n"; |
308 } | 308 } |
309 Str << "\t.text\n"; | 309 Str << "\t.text\n"; |
310 IceString MangledName = getContext()->mangleName(getFunctionName()); | 310 IceString MangledName = getContext()->mangleName(getFunctionName()); |
311 if (Ctx->getFlags().FunctionSections) | 311 if (Ctx->getFlags().FunctionSections) |
312 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; | 312 Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; |
313 if (!getInternal()) { | 313 if (!getInternal()) { |
314 Str << "\t.globl\t" << MangledName << "\n"; | 314 Str << "\t.globl\t" << MangledName << "\n"; |
315 Str << "\t.type\t" << MangledName << ",@function\n"; | 315 Str << "\t.type\t" << MangledName << ",@function\n"; |
316 } | 316 } |
| 317 Str << "\t.p2align " << getTarget()->getBundleAlignLog2Bytes() << ",0x"; |
| 318 llvm::ArrayRef<uint8_t> Pad = getTarget()->getNonExecBundlePadding(); |
| 319 for (llvm::ArrayRef<uint8_t>::iterator I = Pad.begin(), E = Pad.end(); |
| 320 I != E; ++I) { |
| 321 Str.write_hex(*I); |
| 322 } |
| 323 Str << "\n"; |
317 for (NodeList::const_iterator I = Nodes.begin(), E = Nodes.end(); I != E; | 324 for (NodeList::const_iterator I = Nodes.begin(), E = Nodes.end(); I != E; |
318 ++I) { | 325 ++I) { |
319 (*I)->emit(this); | 326 (*I)->emit(this); |
320 } | 327 } |
321 Str << "\n"; | 328 Str << "\n"; |
322 T_emit.printElapsedUs(Ctx, "emit()"); | 329 T_emit.printElapsedUs(Ctx, "emit()"); |
323 } | 330 } |
324 | 331 |
325 // Dumps the IR with an optional introductory message. | 332 // Dumps the IR with an optional introductory message. |
326 void Cfg::dump(const IceString &Message) { | 333 void Cfg::dump(const IceString &Message) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 for (NodeList::const_iterator I = Nodes.begin(), E = Nodes.end(); I != E; | 375 for (NodeList::const_iterator I = Nodes.begin(), E = Nodes.end(); I != E; |
369 ++I) { | 376 ++I) { |
370 (*I)->dump(this); | 377 (*I)->dump(this); |
371 } | 378 } |
372 if (getContext()->isVerbose(IceV_Instructions)) { | 379 if (getContext()->isVerbose(IceV_Instructions)) { |
373 Str << "}\n"; | 380 Str << "}\n"; |
374 } | 381 } |
375 } | 382 } |
376 | 383 |
377 } // end of namespace Ice | 384 } // end of namespace Ice |
OLD | NEW |