From a4f8831d6533e4fe5aed18433099e1130d95a877 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Thu, 16 Apr 2015 12:57:19 +0100 Subject: Remove duplicates phis created during SSA transformation When creating equivalent phis we copy the inputs of the original phi which may be improperly typed. This will be fixed during the type propagation but as a result we may have two equivalent phis with the same type for the same dex register. This is correct but generates more code and prevent some optimizations. This CL adds another step in the SSA builder to remove the extra Phi nodes created due to equality operators. The graph checker verifies that for a given dex register not two phis have the same type. Also, replace zero int constant with null constant when we compare a reference against null. Change-Id: Id37cc11a016ea767c7e351575e003d822a9d2e60 --- compiler/optimizing/ssa_builder.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing/ssa_builder.h') diff --git a/compiler/optimizing/ssa_builder.h b/compiler/optimizing/ssa_builder.h index 569b3e2223..265e95b4ac 100644 --- a/compiler/optimizing/ssa_builder.h +++ b/compiler/optimizing/ssa_builder.h @@ -85,6 +85,9 @@ class SsaBuilder : public HGraphVisitor { static constexpr const char* kSsaBuilderPassName = "ssa_builder"; private: + void FixNullConstantType(); + void EquivalentPhisCleanup(); + static HFloatConstant* GetFloatEquivalent(HIntConstant* constant); static HDoubleConstant* GetDoubleEquivalent(HLongConstant* constant); static HPhi* GetFloatDoubleOrReferenceEquivalentOfPhi(HPhi* phi, Primitive::Type type); -- cgit v1.2.3-59-g8ed1b