Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: src/IceOperand.h

Issue 1411583007: Combine allocas (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix a typo. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 void setMustHaveReg() { RegRequirement = RR_MustHaveRegister; } 506 void setMustHaveReg() { RegRequirement = RR_MustHaveRegister; }
507 bool mustHaveReg() const { return RegRequirement == RR_MustHaveRegister; } 507 bool mustHaveReg() const { return RegRequirement == RR_MustHaveRegister; }
508 void setMustNotHaveReg() { RegRequirement = RR_MustNotHaveRegister; } 508 void setMustNotHaveReg() { RegRequirement = RR_MustNotHaveRegister; }
509 bool mustNotHaveReg() const { 509 bool mustNotHaveReg() const {
510 return RegRequirement == RR_MustNotHaveRegister; 510 return RegRequirement == RR_MustNotHaveRegister;
511 } 511 }
512 512
513 void setRegClass(uint8_t RC) { RegisterClass = static_cast<RegClass>(RC); } 513 void setRegClass(uint8_t RC) { RegisterClass = static_cast<RegClass>(RC); }
514 RegClass getRegClass() const { return RegisterClass; } 514 RegClass getRegClass() const { return RegisterClass; }
515 void setRematerializable(int32_t NewRegNum, int32_t NewOffset) {
Jim Stichnoth 2015/11/11 17:39:45 I would group these methods with the RegRequiremen
sehr 2015/11/11 22:14:10 Done.
516 IsRematerializable = true;
517 setRegNum(NewRegNum);
518 setStackOffset(NewOffset);
519 setMustHaveReg();
520 }
521 bool isRematerializable() const { return IsRematerializable; }
515 522
516 LiveRange &getLiveRange() { return Live; } 523 LiveRange &getLiveRange() { return Live; }
517 const LiveRange &getLiveRange() const { return Live; } 524 const LiveRange &getLiveRange() const { return Live; }
518 void setLiveRange(const LiveRange &Range) { Live = Range; } 525 void setLiveRange(const LiveRange &Range) { Live = Range; }
519 void resetLiveRange() { Live.reset(); } 526 void resetLiveRange() { Live.reset(); }
520 void addLiveRange(InstNumberT Start, InstNumberT End) { 527 void addLiveRange(InstNumberT Start, InstNumberT End) {
521 assert(!getIgnoreLiveness()); 528 assert(!getIgnoreLiveness());
522 Live.addSegment(Start, End); 529 Live.addSegment(Start, End);
523 } 530 }
524 void trimLiveRange(InstNumberT Start) { Live.trim(Start); } 531 void trimLiveRange(InstNumberT Start) { Live.trim(Start); }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 /// Number is unique across all variables, and is used as a (bit)vector index 573 /// Number is unique across all variables, and is used as a (bit)vector index
567 /// for liveness analysis. 574 /// for liveness analysis.
568 const SizeT Number; 575 const SizeT Number;
569 Cfg::IdentifierIndexType NameIndex = Cfg::IdentifierIndexInvalid; 576 Cfg::IdentifierIndexType NameIndex = Cfg::IdentifierIndexInvalid;
570 bool IsArgument = false; 577 bool IsArgument = false;
571 bool IsImplicitArgument = false; 578 bool IsImplicitArgument = false;
572 /// IgnoreLiveness means that the variable should be ignored when constructing 579 /// IgnoreLiveness means that the variable should be ignored when constructing
573 /// and validating live ranges. This is usually reserved for the stack 580 /// and validating live ranges. This is usually reserved for the stack
574 /// pointer and other physical registers specifically referenced by name. 581 /// pointer and other physical registers specifically referenced by name.
575 bool IgnoreLiveness = false; 582 bool IgnoreLiveness = false;
583 // If IsRematerializable, RegNum keeps track of which register (stack or frame
584 // pointer), plus and StackOffset is the known offset from that register.
Jim Stichnoth 2015/11/11 17:39:45 s/plus and/and/
sehr 2015/11/11 22:14:10 Done.
585 bool IsRematerializable = false;
576 RegRequirement RegRequirement = RR_MayHaveRegister; 586 RegRequirement RegRequirement = RR_MayHaveRegister;
577 RegClass RegisterClass; 587 RegClass RegisterClass;
578 /// RegNum is the allocated register, or NoRegister if it isn't 588 /// RegNum is the allocated register, or NoRegister if it isn't
579 /// register-allocated. 589 /// register-allocated.
580 int32_t RegNum = NoRegister; 590 int32_t RegNum = NoRegister;
581 /// RegNumTmp is the tentative assignment during register allocation. 591 /// RegNumTmp is the tentative assignment during register allocation.
582 int32_t RegNumTmp = NoRegister; 592 int32_t RegNumTmp = NoRegister;
583 /// StackOffset is the canonical location on stack (only if 593 /// StackOffset is the canonical location on stack (only if
584 /// RegNum==NoRegister || IsArgument). 594 /// RegNum==NoRegister || IsArgument).
585 int32_t StackOffset = 0; 595 int32_t StackOffset = 0;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 private: 767 private:
758 const Cfg *Func; 768 const Cfg *Func;
759 MetadataKind Kind; 769 MetadataKind Kind;
760 CfgVector<VariableTracking> Metadata; 770 CfgVector<VariableTracking> Metadata;
761 const static InstDefList NoDefinitions; 771 const static InstDefList NoDefinitions;
762 }; 772 };
763 773
764 } // end of namespace Ice 774 } // end of namespace Ice
765 775
766 #endif // SUBZERO_SRC_ICEOPERAND_H 776 #endif // SUBZERO_SRC_ICEOPERAND_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698