summaryrefslogtreecommitdiffstats
path: root/compiler/dex/reg_storage.h
diff options
context:
space:
mode:
authorSerban Constantinescu <serban.constantinescu@arm.com>2014-07-15 17:44:21 +0100
committerbuzbee <buzbee@google.com>2014-07-27 10:06:27 -0700
commitfcc36ba2a2b8fd10e6eebd21ecb6329606443ded (patch)
tree58084b4fdb842b129324e034ac1a195f6d0cee4e /compiler/dex/reg_storage.h
parenta65d63e4eb81605fd798f1ca038d651b0faa29eb (diff)
downloadart-fcc36ba2a2b8fd10e6eebd21ecb6329606443ded.tar.gz
art-fcc36ba2a2b8fd10e6eebd21ecb6329606443ded.tar.bz2
art-fcc36ba2a2b8fd10e6eebd21ecb6329606443ded.zip
Enable Load Store Elimination for ARM and ARM64
This patch refactors the implementation of the LoadStoreElimination optimisation pass. Please note that this pass was disabled and not functional for any of the backends. The current implementation tracks aliases and handles DalvikRegs as well as Heap memory regions. It has been tested and it is known to optimise out the following: * Load - Load * Store - Load * Store - Store * Load Literals Change-Id: Iefae9b696f87f833ef35c451ed4d49c5a1b6fde0
Diffstat (limited to 'compiler/dex/reg_storage.h')
-rw-r--r--compiler/dex/reg_storage.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/compiler/dex/reg_storage.h b/compiler/dex/reg_storage.h
index addd6283a0..706933a1b4 100644
--- a/compiler/dex/reg_storage.h
+++ b/compiler/dex/reg_storage.h
@@ -192,6 +192,18 @@ class RegStorage {
return (reg & (kFloatingPoint | k64BitMask)) == kFloatingPoint;
}
+ static constexpr bool Is32Bit(uint16_t reg) {
+ return ((reg & kShapeMask) == k32BitSolo);
+ }
+
+ static constexpr bool Is64Bit(uint16_t reg) {
+ return ((reg & k64BitMask) == k64Bits);
+ }
+
+ static constexpr bool Is64BitSolo(uint16_t reg) {
+ return ((reg & kShapeMask) == k64BitSolo);
+ }
+
// Used to retrieve either the low register of a pair, or the only register.
int GetReg() const {
DCHECK(!IsPair()) << "reg_ = 0x" << std::hex << reg_;
@@ -265,11 +277,11 @@ class RegStorage {
}
static constexpr bool SameRegType(RegStorage reg1, RegStorage reg2) {
- return (reg1.IsDouble() == reg2.IsDouble()) && (reg1.IsSingle() == reg2.IsSingle());
+ return ((reg1.reg_ & kShapeTypeMask) == (reg2.reg_ & kShapeTypeMask));
}
static constexpr bool SameRegType(int reg1, int reg2) {
- return (IsDouble(reg1) == IsDouble(reg2)) && (IsSingle(reg1) == IsSingle(reg2));
+ return ((reg1 & kShapeTypeMask) == (reg2 & kShapeTypeMask));
}
// Create a 32-bit solo.