| 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 |
| 11 /// \brief Implements the Cfg class. | 11 /// \brief Implements the Cfg class. |
| 12 /// | 12 /// |
| 13 //===----------------------------------------------------------------------===// | 13 //===----------------------------------------------------------------------===// |
| 14 | 14 |
| 15 #include "IceCfg.h" | 15 #include "IceCfg.h" |
| 16 | 16 |
| 17 #include "IceAssembler.h" | 17 #include "IceAssembler.h" |
| 18 #include "IceBitVector.h" | 18 #include "IceBitVector.h" |
| 19 #include "IceCfgNode.h" | 19 #include "IceCfgNode.h" |
| 20 #include "IceClFlags.h" | 20 #include "IceClFlags.h" |
| 21 #include "IceDefs.h" | 21 #include "IceDefs.h" |
| 22 #include "IceELFObjectWriter.h" | 22 #include "IceELFObjectWriter.h" |
| 23 #include "IceGlobalInits.h" | 23 #include "IceGlobalInits.h" |
| 24 #include "IceInst.h" | 24 #include "IceInst.h" |
| 25 #include "IceInstrumentation.h" |
| 25 #include "IceInstVarIter.h" | 26 #include "IceInstVarIter.h" |
| 26 #include "IceLiveness.h" | 27 #include "IceLiveness.h" |
| 27 #include "IceLoopAnalyzer.h" | 28 #include "IceLoopAnalyzer.h" |
| 28 #include "IceOperand.h" | 29 #include "IceOperand.h" |
| 29 #include "IceTargetLowering.h" | 30 #include "IceTargetLowering.h" |
| 30 | 31 |
| 31 #include <memory> | 32 #include <memory> |
| 32 #include <utility> | 33 #include <utility> |
| 33 | 34 |
| 34 namespace Ice { | 35 namespace Ice { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 addCallToProfileSummary(); | 232 addCallToProfileSummary(); |
| 232 } | 233 } |
| 233 dump("Profiled CFG"); | 234 dump("Profiled CFG"); |
| 234 } | 235 } |
| 235 | 236 |
| 236 // Create the Hi and Lo variables where a split was needed | 237 // Create the Hi and Lo variables where a split was needed |
| 237 for (Variable *Var : Variables) | 238 for (Variable *Var : Variables) |
| 238 if (auto *Var64On32 = llvm::dyn_cast<Variable64On32>(Var)) | 239 if (auto *Var64On32 = llvm::dyn_cast<Variable64On32>(Var)) |
| 239 Var64On32->initHiLo(this); | 240 Var64On32->initHiLo(this); |
| 240 | 241 |
| 242 // Instrument the Cfg, e.g. with AddressSanitizer |
| 243 if (!BuildDefs::minimal() && getFlags().getSanitizeAddresses()) { |
| 244 getContext()->instrumentFunc(this); |
| 245 dump("Instrumented CFG"); |
| 246 } |
| 247 |
| 241 // The set of translation passes and their order are determined by the | 248 // The set of translation passes and their order are determined by the |
| 242 // target. | 249 // target. |
| 243 getTarget()->translate(); | 250 getTarget()->translate(); |
| 244 | 251 |
| 245 dump("Final output"); | 252 dump("Final output"); |
| 246 if (getFocusedTiming()) { | 253 if (getFocusedTiming()) { |
| 247 getContext()->dumpLocalTimers(getFunctionName().toString()); | 254 getContext()->dumpLocalTimers(getFunctionName().toString()); |
| 248 } | 255 } |
| 249 } | 256 } |
| 250 | 257 |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 } | 1611 } |
| 1605 } | 1612 } |
| 1606 // Print each basic block | 1613 // Print each basic block |
| 1607 for (CfgNode *Node : Nodes) | 1614 for (CfgNode *Node : Nodes) |
| 1608 Node->dump(this); | 1615 Node->dump(this); |
| 1609 if (isVerbose(IceV_Instructions)) | 1616 if (isVerbose(IceV_Instructions)) |
| 1610 Str << "}\n"; | 1617 Str << "}\n"; |
| 1611 } | 1618 } |
| 1612 | 1619 |
| 1613 } // end of namespace Ice | 1620 } // end of namespace Ice |
| OLD | NEW |