diff options
author | 2017-10-03 11:32:13 +0000 | |
---|---|---|
committer | 2017-10-03 11:32:13 +0000 | |
commit | 5adf26c26d6b662d95712f39c40946e23da8b650 (patch) | |
tree | 1c57801b08a66219e30354156b1e5c08c60a0f18 /compiler/optimizing/induction_var_analysis.cc | |
parent | 25ae37970757ab06bb75b63a933926a4db4bb38d (diff) | |
parent | d5d2f2ce627aa0f6920d7ae05197abd1a396e035 (diff) |
Merge "ART: Introduce Uint8 compiler data type."
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.cc')
-rw-r--r-- | compiler/optimizing/induction_var_analysis.cc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/compiler/optimizing/induction_var_analysis.cc b/compiler/optimizing/induction_var_analysis.cc index fe286ab88a..eab17aad31 100644 --- a/compiler/optimizing/induction_var_analysis.cc +++ b/compiler/optimizing/induction_var_analysis.cc @@ -59,14 +59,19 @@ static void RotateEntryPhiFirst(HLoopInformation* loop, static bool IsNarrowingIntegralConversion(DataType::Type from, DataType::Type to) { switch (from) { case DataType::Type::kInt64: - return to == DataType::Type::kInt8 || to == DataType::Type::kInt16 - || to == DataType::Type::kUint16 || to == DataType::Type::kInt32; + return to == DataType::Type::kUint8 || + to == DataType::Type::kInt8 || + to == DataType::Type::kUint16 || + to == DataType::Type::kInt16 || + to == DataType::Type::kInt32; case DataType::Type::kInt32: - return to == DataType::Type::kInt8 || to == DataType::Type::kInt16 - || to == DataType::Type::kUint16; + return to == DataType::Type::kUint8 || + to == DataType::Type::kInt8 || + to == DataType::Type::kUint16 || + to == DataType::Type::kInt16; case DataType::Type::kUint16: case DataType::Type::kInt16: - return to == DataType::Type::kInt8; + return to == DataType::Type::kUint8 || to == DataType::Type::kInt8; default: return false; } @@ -77,10 +82,11 @@ static bool IsNarrowingIntegralConversion(DataType::Type from, DataType::Type to */ static DataType::Type ImplicitConversion(DataType::Type type) { switch (type) { - case DataType::Type::kInt16: - case DataType::Type::kUint16: - case DataType::Type::kInt8: case DataType::Type::kBool: + case DataType::Type::kUint8: + case DataType::Type::kInt8: + case DataType::Type::kUint16: + case DataType::Type::kInt16: return DataType::Type::kInt32; default: return type; @@ -1142,9 +1148,10 @@ bool HInductionVarAnalysis::IsAtLeast(InductionInfo* info, int64_t* value) { bool HInductionVarAnalysis::IsNarrowingLinear(InductionInfo* info) { return info != nullptr && info->induction_class == kLinear && - (info->type == DataType::Type::kInt8 || - info->type == DataType::Type::kInt16 || + (info->type == DataType::Type::kUint8 || + info->type == DataType::Type::kInt8 || info->type == DataType::Type::kUint16 || + info->type == DataType::Type::kInt16 || (info->type == DataType::Type::kInt32 && (info->op_a->type == DataType::Type::kInt64 || info->op_b->type == DataType::Type::kInt64))); } |