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

Unified Diff: src/IceTargetLoweringARM32.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/IceTargetLowering.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringARM32.h
diff --git a/src/IceTargetLoweringARM32.h b/src/IceTargetLoweringARM32.h
index 198563cda9d7980fe217bfca2de9a4e6941ce38a..6bb7d419310e5088c9d8f2ee13b2301f568256e4 100644
--- a/src/IceTargetLoweringARM32.h
+++ b/src/IceTargetLoweringARM32.h
@@ -72,6 +72,8 @@ public:
SizeT getFrameOrStackReg() const override {
return UsesFramePointer ? RegARM32::Reg_fp : RegARM32::Reg_sp;
}
+ SizeT getReservedTmpReg() const { return RegARM32::Reg_ip; }
+
size_t typeWidthInBytesOnStack(Type Ty) const override {
// Round up to the next multiple of 4 bytes. In particular, i1,
// i8, and i16 are rounded up to 4 bytes.
@@ -380,6 +382,16 @@ protected:
Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred));
}
+ /// Run a pass through stack variables and ensure that the offsets are legal.
+ /// If the offset is not legal, use a new base register that accounts for
+ /// the offset, such that the addressing mode offset bits are now legal.
+ void legalizeStackSlots();
+ /// Returns true if the given Offset can be represented in a stack ldr/str.
+ bool isLegalVariableStackOffset(int32_t Offset) const;
+ /// Assuming Var needs its offset legalized, define a new base register
+ /// centered on the given Var's offset and use it.
+ StackVariable *legalizeVariableSlot(Variable *Var, Variable *OrigBaseReg);
+
TargetARM32Features CPUFeatures;
bool UsesFramePointer = false;
bool NeedsStackAlignment = false;
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698