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

Unified Diff: src/IceTargetLoweringMIPS32.h

Issue 2148593003: [Subzero][MIPS32] Implement post lower legalizer for MIPS32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceTargetLoweringMIPS32.cpp » ('j') | src/IceTargetLoweringMIPS32.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringMIPS32.h
diff --git a/src/IceTargetLoweringMIPS32.h b/src/IceTargetLoweringMIPS32.h
index 9570385c44873a7ea0c893fac1c0cdeee43efa1a..5d49b0140741d9d9fac1f1d5d64f9a49f60c0e43 100644
--- a/src/IceTargetLoweringMIPS32.h
+++ b/src/IceTargetLoweringMIPS32.h
@@ -461,6 +461,8 @@ public:
// the outargs area
void findMaxStackOutArgsSize();
+ void postLowerLegalization();
+
void addProlog(CfgNode *Node) override;
void addEpilog(CfgNode *Node) override;
@@ -559,6 +561,32 @@ protected:
OperandMIPS32Mem *formMemoryOperand(Operand *Ptr, Type Ty);
+ class PostLoweringLegalizer {
+ PostLoweringLegalizer() = delete;
+ PostLoweringLegalizer(const PostLoweringLegalizer &) = delete;
+ PostLoweringLegalizer &operator=(const PostLoweringLegalizer &) = delete;
+
+ public:
+ explicit PostLoweringLegalizer(TargetMIPS32 *Target)
+ : Target(Target), StackOrFrameReg(Target->getPhysicalRegister(
+ Target->getFrameOrStackReg())) {}
+
+ /// Legalizes Mov if its Source (or Destination) is a spilled Variable, or
+ /// if its Source is a Rematerializable variable (this form is used in lieu
+ /// of lea, which is not available in MIPS.)
+ ///
+ /// Moves to memory become store instructions, and moves from memory, loads.
+ void legalizeMov(InstMIPS32Mov *Mov);
+
+ private:
+ /// Creates a new Base register centered around [Base, +/- Offset].
+ Variable *newBaseRegister(Variable *Base, int32_t Offset,
+ RegNumT ScratchRegNum);
+
+ TargetMIPS32 *const Target;
+ Variable *const StackOrFrameReg;
+ };
+
bool UsesFramePointer = false;
bool NeedsStackAlignment = false;
bool MaybeLeafFunc = true;
« no previous file with comments | « no previous file | src/IceTargetLoweringMIPS32.cpp » ('j') | src/IceTargetLoweringMIPS32.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698