OLD | NEW |
1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// | 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// |
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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 538 |
539 // Variable64On32 represents a 64-bit variable on a 32-bit architecture. In | 539 // Variable64On32 represents a 64-bit variable on a 32-bit architecture. In |
540 // this situation the variable must be split into a low and a high word. | 540 // this situation the variable must be split into a low and a high word. |
541 class Variable64On32 : public Variable { | 541 class Variable64On32 : public Variable { |
542 Variable64On32() = delete; | 542 Variable64On32() = delete; |
543 Variable64On32(const Variable64On32 &) = delete; | 543 Variable64On32(const Variable64On32 &) = delete; |
544 Variable64On32 &operator=(const Variable64On32 &) = delete; | 544 Variable64On32 &operator=(const Variable64On32 &) = delete; |
545 | 545 |
546 public: | 546 public: |
547 static Variable64On32 *create(Cfg *Func, Type Ty, SizeT Index) { | 547 static Variable64On32 *create(Cfg *Func, Type Ty, SizeT Index) { |
548 return new (Func->allocate<Variable64On32>()) Variable64On32( | 548 return new (Func->allocate<Variable64On32>()) |
549 kVariable64On32, Ty, Index); | 549 Variable64On32(kVariable64On32, Ty, Index); |
550 } | 550 } |
551 | 551 |
552 void setName(Cfg *Func, const IceString &NewName) override { | 552 void setName(Cfg *Func, const IceString &NewName) override { |
553 Variable::setName(Func, NewName); | 553 Variable::setName(Func, NewName); |
554 if (LoVar && HiVar) { | 554 if (LoVar && HiVar) { |
555 LoVar->setName(Func, getName(Func) + "__lo"); | 555 LoVar->setName(Func, getName(Func) + "__lo"); |
556 HiVar->setName(Func, getName(Func) + "__hi"); | 556 HiVar->setName(Func, getName(Func) + "__hi"); |
557 } | 557 } |
558 } | 558 } |
559 | 559 |
(...skipping 24 matching lines...) Expand all Loading... |
584 LoVar->setName(Func, getName(Func) + "__lo"); | 584 LoVar->setName(Func, getName(Func) + "__lo"); |
585 HiVar->setName(Func, getName(Func) + "__hi"); | 585 HiVar->setName(Func, getName(Func) + "__hi"); |
586 } | 586 } |
587 | 587 |
588 static bool classof(const Operand *Operand) { | 588 static bool classof(const Operand *Operand) { |
589 OperandKind Kind = Operand->getKind(); | 589 OperandKind Kind = Operand->getKind(); |
590 return Kind == kVariable64On32; | 590 return Kind == kVariable64On32; |
591 } | 591 } |
592 | 592 |
593 protected: | 593 protected: |
594 Variable64On32(OperandKind K, Type Ty, SizeT Index) | 594 Variable64On32(OperandKind K, Type Ty, SizeT Index) : Variable(K, Ty, Index) { |
595 : Variable(K, Ty, Index) { | |
596 assert(typeWidthInBytes(Ty) == 8); | 595 assert(typeWidthInBytes(Ty) == 8); |
597 } | 596 } |
598 | 597 |
599 Variable *LoVar = nullptr; | 598 Variable *LoVar = nullptr; |
600 Variable *HiVar = nullptr; | 599 Variable *HiVar = nullptr; |
601 }; | 600 }; |
602 | 601 |
603 enum MetadataKind { | 602 enum MetadataKind { |
604 VMK_Uses, /// Track only uses, not defs | 603 VMK_Uses, /// Track only uses, not defs |
605 VMK_SingleDefs, /// Track uses+defs, but only record single def | 604 VMK_SingleDefs, /// Track uses+defs, but only record single def |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 private: | 700 private: |
702 const Cfg *Func; | 701 const Cfg *Func; |
703 MetadataKind Kind; | 702 MetadataKind Kind; |
704 CfgVector<VariableTracking> Metadata; | 703 CfgVector<VariableTracking> Metadata; |
705 const static InstDefList NoDefinitions; | 704 const static InstDefList NoDefinitions; |
706 }; | 705 }; |
707 | 706 |
708 } // end of namespace Ice | 707 } // end of namespace Ice |
709 | 708 |
710 #endif // SUBZERO_SRC_ICEOPERAND_H | 709 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |