From 217eb067308cf5aa43065377b66acbbee0f5b7c3 Mon Sep 17 00:00:00 2001 From: Mingyao Yang Date: Mon, 11 Dec 2017 15:20:07 -0800 Subject: Fix the side effects of clinit check HClinitCheck obviously does reads so it's side effects should include all reads and writes, just like HInvoke. GVN now explicitly allows clinit check to be reused, which would otherwise be disallowed based on the dependency introduced by the new side effects. Also make licm's logic cleaner and treat clinit check as a special case also, otherwise licm can't hoist clinit check due to the dependency introduced by the new side effects also. Test: run-test on host. Change-Id: I16886cfe557803d84d84ce68fbb185ebfc0b84dc --- compiler/optimizing/nodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 42a9d95b9a..d33f2f1d65 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -6259,7 +6259,7 @@ class HClinitCheck FINAL : public HExpression<1> { HClinitCheck(HLoadClass* constant, uint32_t dex_pc) : HExpression( DataType::Type::kReference, - SideEffects::AllChanges(), // Assume write/read on all fields/arrays. + SideEffects::AllExceptGCDependency(), // Assume write/read on all fields/arrays. dex_pc) { SetRawInputAt(0, constant); } -- cgit v1.2.3-59-g8ed1b