| 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 /// \file | 10 /// \file |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // Allocate the fixed area in the function prolog. | 592 // Allocate the fixed area in the function prolog. |
| 593 getTarget()->reserveFixedAllocaArea(TotalSize, CombinedAlignment); | 593 getTarget()->reserveFixedAllocaArea(TotalSize, CombinedAlignment); |
| 594 } break; | 594 } break; |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 | 597 |
| 598 void Cfg::processAllocas(bool SortAndCombine) { | 598 void Cfg::processAllocas(bool SortAndCombine) { |
| 599 TimerMarker _(TimerStack::TT_alloca, this); | 599 TimerMarker _(TimerStack::TT_alloca, this); |
| 600 const uint32_t StackAlignment = getTarget()->getStackAlignment(); | 600 const uint32_t StackAlignment = getTarget()->getStackAlignment(); |
| 601 CfgNode *EntryNode = getEntryNode(); | 601 CfgNode *EntryNode = getEntryNode(); |
| 602 assert(EntryNode); |
| 602 // LLVM enforces power of 2 alignment. | 603 // LLVM enforces power of 2 alignment. |
| 603 assert(llvm::isPowerOf2_32(StackAlignment)); | 604 assert(llvm::isPowerOf2_32(StackAlignment)); |
| 604 // Determine if there are large alignment allocations in the entry block or | 605 // Determine if there are large alignment allocations in the entry block or |
| 605 // dynamic allocations (variable size in the entry block). | 606 // dynamic allocations (variable size in the entry block). |
| 606 bool HasLargeAlignment = false; | 607 bool HasLargeAlignment = false; |
| 607 bool HasDynamicAllocation = false; | 608 bool HasDynamicAllocation = false; |
| 608 for (Inst &Instr : EntryNode->getInsts()) { | 609 for (Inst &Instr : EntryNode->getInsts()) { |
| 609 if (auto *Alloca = llvm::dyn_cast<InstAlloca>(&Instr)) { | 610 if (auto *Alloca = llvm::dyn_cast<InstAlloca>(&Instr)) { |
| 610 uint32_t AlignmentParam = Alloca->getAlignInBytes(); | 611 uint32_t AlignmentParam = Alloca->getAlignInBytes(); |
| 611 if (AlignmentParam > StackAlignment) | 612 if (AlignmentParam > StackAlignment) |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 } | 1166 } |
| 1166 } | 1167 } |
| 1167 // Print each basic block | 1168 // Print each basic block |
| 1168 for (CfgNode *Node : Nodes) | 1169 for (CfgNode *Node : Nodes) |
| 1169 Node->dump(this); | 1170 Node->dump(this); |
| 1170 if (isVerbose(IceV_Instructions)) | 1171 if (isVerbose(IceV_Instructions)) |
| 1171 Str << "}\n"; | 1172 Str << "}\n"; |
| 1172 } | 1173 } |
| 1173 | 1174 |
| 1174 } // end of namespace Ice | 1175 } // end of namespace Ice |
| OLD | NEW |