Fix pattern replacement for float constant.
Test: New test in run-test 569-checker-pattern-replacement.
Test: testrunner.py --host --optimizing -t 569
Change-Id: I71dc8d2e07d42284f60528c33965186c2fd6e237
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 1df313d..39f684b 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1551,14 +1551,19 @@
*return_replacement = GetInvokeInputForArgVRegIndex(invoke_instruction,
inline_method.d.return_data.arg);
break;
- case kInlineOpNonWideConst:
- if (method->GetShorty()[0] == 'L') {
+ case kInlineOpNonWideConst: {
+ char shorty0 = method->GetShorty()[0];
+ if (shorty0 == 'L') {
DCHECK_EQ(inline_method.d.data, 0u);
*return_replacement = graph_->GetNullConstant();
+ } else if (shorty0 == 'F') {
+ *return_replacement = graph_->GetFloatConstant(
+ bit_cast<float, int32_t>(static_cast<int32_t>(inline_method.d.data)));
} else {
*return_replacement = graph_->GetIntConstant(static_cast<int32_t>(inline_method.d.data));
}
break;
+ }
case kInlineOpIGet: {
const InlineIGetIPutData& data = inline_method.d.ifield_data;
if (data.method_is_static || data.object_arg != 0u) {