| 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 15 matching lines...) Expand all Loading... |
| 26 #include "IceLiveness.h" | 26 #include "IceLiveness.h" |
| 27 #include "IceLoopAnalyzer.h" | 27 #include "IceLoopAnalyzer.h" |
| 28 #include "IceOperand.h" | 28 #include "IceOperand.h" |
| 29 #include "IceTargetLowering.h" | 29 #include "IceTargetLowering.h" |
| 30 | 30 |
| 31 namespace Ice { | 31 namespace Ice { |
| 32 | 32 |
| 33 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) | 33 Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber) |
| 34 : Ctx(Ctx), SequenceNumber(SequenceNumber), | 34 : Ctx(Ctx), SequenceNumber(SequenceNumber), |
| 35 VMask(Ctx->getFlags().getVerbose()), NextInstNumber(Inst::NumberInitial), | 35 VMask(Ctx->getFlags().getVerbose()), NextInstNumber(Inst::NumberInitial), |
| 36 Allocator(new ArenaAllocator()), Live(nullptr), | 36 Live(nullptr) { |
| 37 Target(TargetLowering::createLowering(Ctx->getFlags().getTargetArch(), | 37 Allocator.reset(new ArenaAllocator()); |
| 38 this)), | 38 CfgLocalAllocatorScope _(this); |
| 39 VMetadata(new VariablesMetadata(this)), | 39 Target = |
| 40 TargetAssembler(Target->createAssembler()) { | 40 TargetLowering::createLowering(Ctx->getFlags().getTargetArch(), this); |
| 41 VMetadata.reset(new VariablesMetadata(this)); |
| 42 TargetAssembler = Target->createAssembler(); |
| 43 |
| 41 if (Ctx->getFlags().getRandomizeAndPoolImmediatesOption() == RPI_Randomize) { | 44 if (Ctx->getFlags().getRandomizeAndPoolImmediatesOption() == RPI_Randomize) { |
| 42 // If -randomize-pool-immediates=randomize, create a random number | 45 // If -randomize-pool-immediates=randomize, create a random number |
| 43 // generator to generate a cookie for constant blinding. | 46 // generator to generate a cookie for constant blinding. |
| 44 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), | 47 RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), |
| 45 RPE_ConstantBlinding, this->SequenceNumber); | 48 RPE_ConstantBlinding, this->SequenceNumber); |
| 46 ConstantBlindingCookie = | 49 ConstantBlindingCookie = |
| 47 (uint32_t)RNG.next((uint64_t)std::numeric_limits<uint32_t>::max() + 1); | 50 (uint32_t)RNG.next((uint64_t)std::numeric_limits<uint32_t>::max() + 1); |
| 48 } | 51 } |
| 49 } | 52 } |
| 50 | 53 |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 } | 1132 } |
| 1130 } | 1133 } |
| 1131 // Print each basic block | 1134 // Print each basic block |
| 1132 for (CfgNode *Node : Nodes) | 1135 for (CfgNode *Node : Nodes) |
| 1133 Node->dump(this); | 1136 Node->dump(this); |
| 1134 if (isVerbose(IceV_Instructions)) | 1137 if (isVerbose(IceV_Instructions)) |
| 1135 Str << "}\n"; | 1138 Str << "}\n"; |
| 1136 } | 1139 } |
| 1137 | 1140 |
| 1138 } // end of namespace Ice | 1141 } // end of namespace Ice |
| OLD | NEW |