summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-12-18 23:10:26 +0000
committer android-build-merger <android-build-merger@google.com> 2015-12-18 23:10:26 +0000
commit504f0caed8f08b59a4673c7bad91231caa4eb0a3 (patch)
tree7e81418d73da8d0828168cccbafc1889e1f2be84 /compiler/optimizing
parentff4ce487c3ac06a5c1cc5f80b3a07589fd4d42e2 (diff)
parentbd968bd36f9948d27f63cc1a7abb602ab9264f06 (diff)
Merge "ART: Fix bug in LSE" am: d9493c2d61
am: bd968bd36f * commit 'bd968bd36f9948d27f63cc1a7abb602ab9264f06': ART: Fix bug in LSE
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/load_store_elimination.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc
index adde00464b..2a2221a82c 100644
--- a/compiler/optimizing/load_store_elimination.cc
+++ b/compiler/optimizing/load_store_elimination.cc
@@ -655,6 +655,16 @@ class LSEVisitor : public HGraphVisitor {
}
}
+ static bool IsIntFloatAlias(Primitive::Type type1, Primitive::Type type2) {
+ return (type1 == Primitive::kPrimFloat && type2 == Primitive::kPrimInt) ||
+ (type2 == Primitive::kPrimFloat && type1 == Primitive::kPrimInt);
+ }
+
+ static bool IsLongDoubleAlias(Primitive::Type type1, Primitive::Type type2) {
+ return (type1 == Primitive::kPrimDouble && type2 == Primitive::kPrimLong) ||
+ (type2 == Primitive::kPrimDouble && type1 == Primitive::kPrimLong);
+ }
+
void VisitGetLocation(HInstruction* instruction,
HInstruction* ref,
size_t offset,
@@ -686,7 +696,8 @@ class LSEVisitor : public HGraphVisitor {
if ((heap_value != kUnknownHeapValue) &&
// Keep the load due to possible I/F, J/D array aliasing.
// See b/22538329 for details.
- (heap_value->GetType() == instruction->GetType())) {
+ !IsIntFloatAlias(heap_value->GetType(), instruction->GetType()) &&
+ !IsLongDoubleAlias(heap_value->GetType(), instruction->GetType())) {
removed_loads_.push_back(instruction);
substitute_instructions_for_loads_.push_back(heap_value);
TryRemovingNullCheck(instruction);