MachineFunction.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. //===-- MachineFunction.cpp -----------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // Collect native machine code information for a function. This allows
  11. // target-specific information about the generated code to be stored with each
  12. // function.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #include "llvm/DerivedTypes.h"
  16. #include "llvm/Function.h"
  17. #include "llvm/Instructions.h"
  18. #include "llvm/ADT/STLExtras.h"
  19. #include "llvm/Config/config.h"
  20. #include "llvm/CodeGen/MachineConstantPool.h"
  21. #include "llvm/CodeGen/MachineFunctionPass.h"
  22. #include "llvm/CodeGen/MachineFrameInfo.h"
  23. #include "llvm/CodeGen/MachineInstr.h"
  24. #include "llvm/CodeGen/MachineJumpTableInfo.h"
  25. #include "llvm/CodeGen/MachineRegisterInfo.h"
  26. #include "llvm/CodeGen/Passes.h"
  27. #include "llvm/Target/TargetData.h"
  28. #include "llvm/Target/TargetLowering.h"
  29. #include "llvm/Target/TargetMachine.h"
  30. #include "llvm/Target/TargetFrameInfo.h"
  31. #include "llvm/Support/Compiler.h"
  32. #include "llvm/Support/GraphWriter.h"
  33. #include "llvm/Support/raw_ostream.h"
  34. #include <fstream>
  35. #include <sstream>
  36. using namespace llvm;
  37. namespace {
  38. struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
  39. static char ID;
  40. std::ostream *OS;
  41. const std::string Banner;
  42. Printer (std::ostream *os, const std::string &banner)
  43. : MachineFunctionPass(&ID), OS(os), Banner(banner) {}
  44. const char *getPassName() const { return "MachineFunction Printer"; }
  45. virtual void getAnalysisUsage(AnalysisUsage &AU) const {
  46. AU.setPreservesAll();
  47. MachineFunctionPass::getAnalysisUsage(AU);
  48. }
  49. bool runOnMachineFunction(MachineFunction &MF) {
  50. (*OS) << Banner;
  51. MF.print (*OS);
  52. return false;
  53. }
  54. };
  55. char Printer::ID = 0;
  56. }
  57. /// Returns a newly-created MachineFunction Printer pass. The default banner is
  58. /// empty.
  59. ///
  60. FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
  61. const std::string &Banner){
  62. return new Printer(OS, Banner);
  63. }
  64. //===---------------------------------------------------------------------===//
  65. // MachineFunction implementation
  66. //===---------------------------------------------------------------------===//
  67. void ilist_traits<MachineBasicBlock>::deleteNode(MachineBasicBlock *MBB) {
  68. MBB->getParent()->DeleteMachineBasicBlock(MBB);
  69. }
  70. MachineFunction::MachineFunction(Function *F,
  71. const TargetMachine &TM)
  72. : Fn(F), Target(TM) {
  73. if (TM.getRegisterInfo())
  74. RegInfo = new (Allocator.Allocate<MachineRegisterInfo>())
  75. MachineRegisterInfo(*TM.getRegisterInfo());
  76. else
  77. RegInfo = 0;
  78. MFInfo = 0;
  79. FrameInfo = new (Allocator.Allocate<MachineFrameInfo>())
  80. MachineFrameInfo(*TM.getFrameInfo());
  81. ConstantPool = new (Allocator.Allocate<MachineConstantPool>())
  82. MachineConstantPool(TM.getTargetData());
  83. Alignment = TM.getTargetLowering()->getFunctionAlignment(F);
  84. CallSiteIndex = 0;
  85. MaxCallSiteIndex = 0;
  86. // Set up jump table.
  87. const TargetData &TD = *TM.getTargetData();
  88. bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
  89. unsigned EntrySize = IsPic ? 4 : TD.getPointerSize();
  90. unsigned TyAlignment = IsPic ?
  91. TD.getABITypeAlignment(Type::getInt32Ty(F->getContext()))
  92. : TD.getPointerABIAlignment();
  93. JumpTableInfo = new (Allocator.Allocate<MachineJumpTableInfo>())
  94. MachineJumpTableInfo(EntrySize, TyAlignment);
  95. }
  96. MachineFunction::~MachineFunction() {
  97. BasicBlocks.clear();
  98. InstructionRecycler.clear(Allocator);
  99. BasicBlockRecycler.clear(Allocator);
  100. if (RegInfo) {
  101. RegInfo->~MachineRegisterInfo();
  102. Allocator.Deallocate(RegInfo);
  103. }
  104. if (MFInfo) {
  105. MFInfo->~MachineFunctionInfo();
  106. Allocator.Deallocate(MFInfo);
  107. }
  108. FrameInfo->~MachineFrameInfo(); Allocator.Deallocate(FrameInfo);
  109. ConstantPool->~MachineConstantPool(); Allocator.Deallocate(ConstantPool);
  110. JumpTableInfo->~MachineJumpTableInfo(); Allocator.Deallocate(JumpTableInfo);
  111. }
  112. /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and
  113. /// recomputes them. This guarantees that the MBB numbers are sequential,
  114. /// dense, and match the ordering of the blocks within the function. If a
  115. /// specific MachineBasicBlock is specified, only that block and those after
  116. /// it are renumbered.
  117. void MachineFunction::RenumberBlocks(MachineBasicBlock *MBB) {
  118. if (empty()) { MBBNumbering.clear(); return; }
  119. MachineFunction::iterator MBBI, E = end();
  120. if (MBB == 0)
  121. MBBI = begin();
  122. else
  123. MBBI = MBB;
  124. // Figure out the block number this should have.
  125. unsigned BlockNo = 0;
  126. if (MBBI != begin())
  127. BlockNo = prior(MBBI)->getNumber()+1;
  128. for (; MBBI != E; ++MBBI, ++BlockNo) {
  129. if (MBBI->getNumber() != (int)BlockNo) {
  130. // Remove use of the old number.
  131. if (MBBI->getNumber() != -1) {
  132. assert(MBBNumbering[MBBI->getNumber()] == &*MBBI &&
  133. "MBB number mismatch!");
  134. MBBNumbering[MBBI->getNumber()] = 0;
  135. }
  136. // If BlockNo is already taken, set that block's number to -1.
  137. if (MBBNumbering[BlockNo])
  138. MBBNumbering[BlockNo]->setNumber(-1);
  139. MBBNumbering[BlockNo] = MBBI;
  140. MBBI->setNumber(BlockNo);
  141. }
  142. }
  143. // Okay, all the blocks are renumbered. If we have compactified the block
  144. // numbering, shrink MBBNumbering now.
  145. assert(BlockNo <= MBBNumbering.size() && "Mismatch!");
  146. MBBNumbering.resize(BlockNo);
  147. }
  148. /// CreateMachineInstr - Allocate a new MachineInstr. Use this instead
  149. /// of `new MachineInstr'.
  150. ///
  151. MachineInstr *
  152. MachineFunction::CreateMachineInstr(const TargetInstrDesc &TID,
  153. DebugLoc DL, bool NoImp) {
  154. return new (InstructionRecycler.Allocate<MachineInstr>(Allocator))
  155. MachineInstr(TID, DL, NoImp);
  156. }
  157. /// CloneMachineInstr - Create a new MachineInstr which is a copy of the
  158. /// 'Orig' instruction, identical in all ways except the the instruction
  159. /// has no parent, prev, or next.
  160. ///
  161. MachineInstr *
  162. MachineFunction::CloneMachineInstr(const MachineInstr *Orig) {
  163. return new (InstructionRecycler.Allocate<MachineInstr>(Allocator))
  164. MachineInstr(*this, *Orig);
  165. }
  166. /// DeleteMachineInstr - Delete the given MachineInstr.
  167. ///
  168. void
  169. MachineFunction::DeleteMachineInstr(MachineInstr *MI) {
  170. // Clear the instructions memoperands. This must be done manually because
  171. // the instruction's parent pointer is now null, so it can't properly
  172. // deallocate them on its own.
  173. MI->clearMemOperands(*this);
  174. MI->~MachineInstr();
  175. InstructionRecycler.Deallocate(Allocator, MI);
  176. }
  177. /// CreateMachineBasicBlock - Allocate a new MachineBasicBlock. Use this
  178. /// instead of `new MachineBasicBlock'.
  179. ///
  180. MachineBasicBlock *
  181. MachineFunction::CreateMachineBasicBlock(const BasicBlock *bb) {
  182. return new (BasicBlockRecycler.Allocate<MachineBasicBlock>(Allocator))
  183. MachineBasicBlock(*this, bb);
  184. }
  185. /// DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
  186. ///
  187. void
  188. MachineFunction::DeleteMachineBasicBlock(MachineBasicBlock *MBB) {
  189. assert(MBB->getParent() == this && "MBB parent mismatch!");
  190. MBB->~MachineBasicBlock();
  191. BasicBlockRecycler.Deallocate(Allocator, MBB);
  192. }
  193. void MachineFunction::dump() const {
  194. print(*cerr.stream());
  195. }
  196. void MachineFunction::print(std::ostream &OS,
  197. const PrefixPrinter &prefix) const {
  198. OS << "# Machine code for " << Fn->getNameStr () << "():\n";
  199. // Print Frame Information
  200. FrameInfo->print(*this, OS);
  201. // Print JumpTable Information
  202. JumpTableInfo->print(OS);
  203. // Print Constant Pool
  204. {
  205. raw_os_ostream OSS(OS);
  206. ConstantPool->print(OSS);
  207. }
  208. const TargetRegisterInfo *TRI = getTarget().getRegisterInfo();
  209. if (RegInfo && !RegInfo->livein_empty()) {
  210. OS << "Live Ins:";
  211. for (MachineRegisterInfo::livein_iterator
  212. I = RegInfo->livein_begin(), E = RegInfo->livein_end(); I != E; ++I) {
  213. if (TRI)
  214. OS << " " << TRI->getName(I->first);
  215. else
  216. OS << " Reg #" << I->first;
  217. if (I->second)
  218. OS << " in VR#" << I->second << " ";
  219. }
  220. OS << "\n";
  221. }
  222. if (RegInfo && !RegInfo->liveout_empty()) {
  223. OS << "Live Outs:";
  224. for (MachineRegisterInfo::liveout_iterator
  225. I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I)
  226. if (TRI)
  227. OS << " " << TRI->getName(*I);
  228. else
  229. OS << " Reg #" << *I;
  230. OS << "\n";
  231. }
  232. for (const_iterator BB = begin(); BB != end(); ++BB) {
  233. prefix(OS, *BB);
  234. BB->print(OS, prefix);
  235. }
  236. OS << "\n# End machine code for " << Fn->getNameStr () << "().\n\n";
  237. }
  238. namespace llvm {
  239. template<>
  240. struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
  241. static std::string getGraphName(const MachineFunction *F) {
  242. return "CFG for '" + F->getFunction()->getNameStr() + "' function";
  243. }
  244. static std::string getNodeLabel(const MachineBasicBlock *Node,
  245. const MachineFunction *Graph,
  246. bool ShortNames) {
  247. if (ShortNames && Node->getBasicBlock() &&
  248. !Node->getBasicBlock()->getName().empty())
  249. return Node->getBasicBlock()->getNameStr() + ":";
  250. std::ostringstream Out;
  251. if (ShortNames) {
  252. Out << Node->getNumber() << ':';
  253. return Out.str();
  254. }
  255. Node->print(Out);
  256. std::string OutStr = Out.str();
  257. if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
  258. // Process string output to make it nicer...
  259. for (unsigned i = 0; i != OutStr.length(); ++i)
  260. if (OutStr[i] == '\n') { // Left justify
  261. OutStr[i] = '\\';
  262. OutStr.insert(OutStr.begin()+i+1, 'l');
  263. }
  264. return OutStr;
  265. }
  266. };
  267. }
  268. void MachineFunction::viewCFG() const
  269. {
  270. #ifndef NDEBUG
  271. ViewGraph(this, "mf" + getFunction()->getNameStr());
  272. #else
  273. cerr << "SelectionDAG::viewGraph is only available in debug builds on "
  274. << "systems with Graphviz or gv!\n";
  275. #endif // NDEBUG
  276. }
  277. void MachineFunction::viewCFGOnly() const
  278. {
  279. #ifndef NDEBUG
  280. ViewGraph(this, "mf" + getFunction()->getNameStr(), true);
  281. #else
  282. cerr << "SelectionDAG::viewGraph is only available in debug builds on "
  283. << "systems with Graphviz or gv!\n";
  284. #endif // NDEBUG
  285. }
  286. /// addLiveIn - Add the specified physical register as a live-in value and
  287. /// create a corresponding virtual register for it.
  288. unsigned MachineFunction::addLiveIn(unsigned PReg,
  289. const TargetRegisterClass *RC) {
  290. assert(RC->contains(PReg) && "Not the correct regclass!");
  291. unsigned VReg = getRegInfo().createVirtualRegister(RC);
  292. getRegInfo().addLiveIn(PReg, VReg);
  293. return VReg;
  294. }
  295. /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given
  296. /// source file, line, and column. If none currently exists, create a new
  297. /// DebugLocTuple, and insert it into the DebugIdMap.
  298. unsigned MachineFunction::getOrCreateDebugLocID(GlobalVariable *CompileUnit,
  299. unsigned Line, unsigned Col) {
  300. DebugLocTuple Tuple(CompileUnit, Line, Col);
  301. DenseMap<DebugLocTuple, unsigned>::iterator II
  302. = DebugLocInfo.DebugIdMap.find(Tuple);
  303. if (II != DebugLocInfo.DebugIdMap.end())
  304. return II->second;
  305. // Add a new tuple.
  306. unsigned Id = DebugLocInfo.DebugLocations.size();
  307. DebugLocInfo.DebugLocations.push_back(Tuple);
  308. DebugLocInfo.DebugIdMap[Tuple] = Id;
  309. return Id;
  310. }
  311. /// getDebugLocTuple - Get the DebugLocTuple for a given DebugLoc object.
  312. DebugLocTuple MachineFunction::getDebugLocTuple(DebugLoc DL) const {
  313. unsigned Idx = DL.getIndex();
  314. assert(Idx < DebugLocInfo.DebugLocations.size() &&
  315. "Invalid index into debug locations!");
  316. return DebugLocInfo.DebugLocations[Idx];
  317. }
  318. //===----------------------------------------------------------------------===//
  319. // MachineFrameInfo implementation
  320. //===----------------------------------------------------------------------===//
  321. /// CreateFixedObject - Create a new object at a fixed location on the stack.
  322. /// All fixed objects should be created before other objects are created for
  323. /// efficiency. By default, fixed objects are immutable. This returns an
  324. /// index with a negative value.
  325. ///
  326. int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset,
  327. bool Immutable) {
  328. assert(Size != 0 && "Cannot allocate zero size fixed stack objects!");
  329. Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset, Immutable));
  330. return -++NumFixedObjects;
  331. }
  332. BitVector
  333. MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const {
  334. assert(MBB && "MBB must be valid");
  335. const MachineFunction *MF = MBB->getParent();
  336. assert(MF && "MBB must be part of a MachineFunction");
  337. const TargetMachine &TM = MF->getTarget();
  338. const TargetRegisterInfo *TRI = TM.getRegisterInfo();
  339. BitVector BV(TRI->getNumRegs());
  340. // Before CSI is calculated, no registers are considered pristine. They can be
  341. // freely used and PEI will make sure they are saved.
  342. if (!isCalleeSavedInfoValid())
  343. return BV;
  344. for (const unsigned *CSR = TRI->getCalleeSavedRegs(MF); CSR && *CSR; ++CSR)
  345. BV.set(*CSR);
  346. // The entry MBB always has all CSRs pristine.
  347. if (MBB == &MF->front())
  348. return BV;
  349. // On other MBBs the saved CSRs are not pristine.
  350. const std::vector<CalleeSavedInfo> &CSI = getCalleeSavedInfo();
  351. for (std::vector<CalleeSavedInfo>::const_iterator I = CSI.begin(),
  352. E = CSI.end(); I != E; ++I)
  353. BV.reset(I->getReg());
  354. return BV;
  355. }
  356. void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
  357. const TargetFrameInfo *FI = MF.getTarget().getFrameInfo();
  358. int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0);
  359. for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
  360. const StackObject &SO = Objects[i];
  361. OS << " <fi#" << (int)(i-NumFixedObjects) << ">: ";
  362. if (SO.Size == ~0ULL) {
  363. OS << "dead\n";
  364. continue;
  365. }
  366. if (SO.Size == 0)
  367. OS << "variable sized";
  368. else
  369. OS << "size is " << SO.Size << " byte" << (SO.Size != 1 ? "s," : ",");
  370. OS << " alignment is " << SO.Alignment << " byte"
  371. << (SO.Alignment != 1 ? "s," : ",");
  372. if (i < NumFixedObjects)
  373. OS << " fixed";
  374. if (i < NumFixedObjects || SO.SPOffset != -1) {
  375. int64_t Off = SO.SPOffset - ValOffset;
  376. OS << " at location [SP";
  377. if (Off > 0)
  378. OS << "+" << Off;
  379. else if (Off < 0)
  380. OS << Off;
  381. OS << "]";
  382. }
  383. OS << "\n";
  384. }
  385. if (HasVarSizedObjects)
  386. OS << " Stack frame contains variable sized objects\n";
  387. }
  388. void MachineFrameInfo::dump(const MachineFunction &MF) const {
  389. print(MF, *cerr.stream());
  390. }
  391. //===----------------------------------------------------------------------===//
  392. // MachineJumpTableInfo implementation
  393. //===----------------------------------------------------------------------===//
  394. /// getJumpTableIndex - Create a new jump table entry in the jump table info
  395. /// or return an existing one.
  396. ///
  397. unsigned MachineJumpTableInfo::getJumpTableIndex(
  398. const std::vector<MachineBasicBlock*> &DestBBs) {
  399. assert(!DestBBs.empty() && "Cannot create an empty jump table!");
  400. for (unsigned i = 0, e = JumpTables.size(); i != e; ++i)
  401. if (JumpTables[i].MBBs == DestBBs)
  402. return i;
  403. JumpTables.push_back(MachineJumpTableEntry(DestBBs));
  404. return JumpTables.size()-1;
  405. }
  406. /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
  407. /// the jump tables to branch to New instead.
  408. bool
  409. MachineJumpTableInfo::ReplaceMBBInJumpTables(MachineBasicBlock *Old,
  410. MachineBasicBlock *New) {
  411. assert(Old != New && "Not making a change?");
  412. bool MadeChange = false;
  413. for (size_t i = 0, e = JumpTables.size(); i != e; ++i) {
  414. MachineJumpTableEntry &JTE = JumpTables[i];
  415. for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j)
  416. if (JTE.MBBs[j] == Old) {
  417. JTE.MBBs[j] = New;
  418. MadeChange = true;
  419. }
  420. }
  421. return MadeChange;
  422. }
  423. void MachineJumpTableInfo::print(std::ostream &OS) const {
  424. // FIXME: this is lame, maybe we could print out the MBB numbers or something
  425. // like {1, 2, 4, 5, 3, 0}
  426. for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
  427. OS << " <jt#" << i << "> has " << JumpTables[i].MBBs.size()
  428. << " entries\n";
  429. }
  430. }
  431. void MachineJumpTableInfo::dump() const { print(*cerr.stream()); }
  432. //===----------------------------------------------------------------------===//
  433. // MachineConstantPool implementation
  434. //===----------------------------------------------------------------------===//
  435. const Type *MachineConstantPoolEntry::getType() const {
  436. if (isMachineConstantPoolEntry())
  437. return Val.MachineCPVal->getType();
  438. return Val.ConstVal->getType();
  439. }
  440. unsigned MachineConstantPoolEntry::getRelocationInfo() const {
  441. if (isMachineConstantPoolEntry())
  442. return Val.MachineCPVal->getRelocationInfo();
  443. return Val.ConstVal->getRelocationInfo();
  444. }
  445. MachineConstantPool::~MachineConstantPool() {
  446. for (unsigned i = 0, e = Constants.size(); i != e; ++i)
  447. if (Constants[i].isMachineConstantPoolEntry())
  448. delete Constants[i].Val.MachineCPVal;
  449. }
  450. /// getConstantPoolIndex - Create a new entry in the constant pool or return
  451. /// an existing one. User must specify the log2 of the minimum required
  452. /// alignment for the object.
  453. ///
  454. unsigned MachineConstantPool::getConstantPoolIndex(Constant *C,
  455. unsigned Alignment) {
  456. assert(Alignment && "Alignment must be specified!");
  457. if (Alignment > PoolAlignment) PoolAlignment = Alignment;
  458. // Check to see if we already have this constant.
  459. //
  460. // FIXME, this could be made much more efficient for large constant pools.
  461. for (unsigned i = 0, e = Constants.size(); i != e; ++i)
  462. if (Constants[i].Val.ConstVal == C &&
  463. (Constants[i].getAlignment() & (Alignment - 1)) == 0)
  464. return i;
  465. Constants.push_back(MachineConstantPoolEntry(C, Alignment));
  466. return Constants.size()-1;
  467. }
  468. unsigned MachineConstantPool::getConstantPoolIndex(MachineConstantPoolValue *V,
  469. unsigned Alignment) {
  470. assert(Alignment && "Alignment must be specified!");
  471. if (Alignment > PoolAlignment) PoolAlignment = Alignment;
  472. // Check to see if we already have this constant.
  473. //
  474. // FIXME, this could be made much more efficient for large constant pools.
  475. int Idx = V->getExistingMachineCPValue(this, Alignment);
  476. if (Idx != -1)
  477. return (unsigned)Idx;
  478. Constants.push_back(MachineConstantPoolEntry(V, Alignment));
  479. return Constants.size()-1;
  480. }
  481. void MachineConstantPool::print(raw_ostream &OS) const {
  482. for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
  483. OS << " <cp#" << i << "> is";
  484. if (Constants[i].isMachineConstantPoolEntry())
  485. Constants[i].Val.MachineCPVal->print(OS);
  486. else
  487. OS << *(Value*)Constants[i].Val.ConstVal;
  488. OS << " , alignment=" << Constants[i].getAlignment();
  489. OS << "\n";
  490. }
  491. }
  492. void MachineConstantPool::dump() const { print(errs()); }