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

Unified Diff: src/IceInstARM32.h

Issue 1241763002: ARM: Add a postRA pass to legalize stack offsets. Greedy approach (reserve IP). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review Created 5 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 | « src/IceClFlags.cpp ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstARM32.h
diff --git a/src/IceInstARM32.h b/src/IceInstARM32.h
index 030c194fc047660205950cef9e34cd739b0697fe..d254180d8e3c9d28d47b4ec8837db7ee90d4967f 100644
--- a/src/IceInstARM32.h
+++ b/src/IceInstARM32.h
@@ -242,6 +242,35 @@ private:
Operand *ShiftAmt;
};
+/// StackVariable represents a Var that isn't assigned a register (stack-only).
+/// It is assigned a stack slot, but the slot's offset may be too large to
+/// represent in the native addressing mode, and so it has a separate
+/// base register from SP/FP, where the offset from that base register is
+/// then in range.
+class StackVariable final : public Variable {
+ StackVariable() = delete;
+ StackVariable(const StackVariable &) = delete;
+ StackVariable &operator=(const StackVariable &) = delete;
+
+public:
+ static StackVariable *create(Cfg *Func, Type Ty, SizeT Index) {
+ return new (Func->allocate<StackVariable>()) StackVariable(Ty, Index);
+ }
+ const static OperandKind StackVariableKind =
+ static_cast<OperandKind>(kVariable_Target);
+ static bool classof(const Operand *Operand) {
+ return Operand->getKind() == StackVariableKind;
+ }
+ void setBaseRegNum(int32_t RegNum) { BaseRegNum = RegNum; }
+ int32_t getBaseRegNum() const override { return BaseRegNum; }
+ // Inherit dump() and emit() from Variable.
+
+private:
+ StackVariable(Type Ty, SizeT Index)
+ : Variable(StackVariableKind, Ty, Index) {}
+ int32_t BaseRegNum = Variable::NoRegister;
+};
+
/// Base class for ARM instructions. While most ARM instructions can be
/// conditionally executed, a few of them are not predicable (halt,
/// memory barriers, etc.).
@@ -778,6 +807,7 @@ public:
void emitIAS(const Cfg *Func) const override;
void dump(const Cfg *Func) const override;
static bool classof(const Inst *Inst) { return isClassof(Inst, Adjuststack); }
+ SizeT getAmount() const { return Amount; }
private:
InstARM32AdjustStack(Cfg *Func, Variable *SP, SizeT Amount,
« no previous file with comments | « src/IceClFlags.cpp ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698