summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2015-06-27 13:32:11 +0100
committerbuzbee <buzbee@google.com>2015-06-27 08:05:58 -0700
commita10c713ec3d5349cb907c184ebbd66e93b2dda99 (patch)
tree469d9c3d436ba4040e99b0ae38fd1593951a5e65 /compiler
parent3ae8da0a803370be9dd410226438f636af553e22 (diff)
downloadart-a10c713ec3d5349cb907c184ebbd66e93b2dda99.zip
art-a10c713ec3d5349cb907c184ebbd66e93b2dda99.tar.gz
art-a10c713ec3d5349cb907c184ebbd66e93b2dda99.tar.bz2
Quick: Disable GVN, DCE and LVN for type conflicts.
(cherry picked from commit f7e7327d7a873d21aaae01471f46a4d64d65433b) Bug: 22136903 Change-Id: I657d4b5e623696e1264c2c6c9ad4e7fd466d759c
Diffstat (limited to 'compiler')
-rw-r--r--compiler/dex/type_inference.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/dex/type_inference.cc b/compiler/dex/type_inference.cc
index a0dfcbe..c93fe20 100644
--- a/compiler/dex/type_inference.cc
+++ b/compiler/dex/type_inference.cc
@@ -572,15 +572,21 @@ void TypeInference::Finish() {
if (type_conflict) {
/*
- * We don't normally expect to see a Dalvik register definition used both as a
- * floating point and core value, though technically it could happen with constants.
- * Until we have proper typing, detect this situation and disable register promotion
- * (which relies on the distinction between core a fp usages).
+ * Each dalvik register definition should be used either as a reference, or an
+ * integer or a floating point value. We don't normally expect to see a Dalvik
+ * register definition used in two or three of these roles though technically it
+ * could happen with constants (0 for all three roles, non-zero for integer and
+ * FP). Detect this situation and disable optimizations that rely on correct
+ * typing, i.e. register promotion, GVN/LVN and GVN-based DCE.
*/
LOG(WARNING) << PrettyMethod(cu_->method_idx, *cu_->dex_file)
<< " has type conflict block for sreg " << conflict_s_reg
<< ", disabling register promotion.";
- cu_->disable_opt |= (1 << kPromoteRegs);
+ cu_->disable_opt |=
+ (1u << kPromoteRegs) |
+ (1u << kGlobalValueNumbering) |
+ (1u << kGvnDeadCodeElimination) |
+ (1u << kLocalValueNumbering);
}
}