Remove generic comparison IR ops
commitbbff70c6ccbff3ff19233c6ff1e4cedcf12b13f3
authorRick Lavoie <rlavoie@fb.com>
Wed, 26 Aug 2015 00:28:01 +0000 (25 17:28 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Wed, 26 Aug 2015 00:31:05 +0000 (25 17:31 -0700)
tree80904a9b36ac9d37265867eede551160cfceca3f
parent8cb9eab044c2f52587e435a2f7750df31eb0620f
Remove generic comparison IR ops

Summary: Now that all the type-specific comparison IR ops have been added,
remove the generic comparison IR ops. Since the type-specific comparison IR ops
only compare two operands of the same type, IR-gen is now responsible for
emitting the right set of type conversions to convert mixed-type comparisons to
same-type comparisons.

However, string-int comparisons are special and cannot be easily represented in
the IR directly. Therefore, add a set of string-int comparison IR ops. In
addition, add new IR opcodes "IsCol", "HasToString", and "ThrowInvalidOperation"
to support all the necessary semantics for comparing collections and supporting
object-string comparisons.

Add additional cases to all_type_comparison_test.php, namely testing for
comparing NANs and special XmlNode cases.

Reviewed By: @ottoni

Differential Revision: D2375339
23 files changed:
hphp/doc/ir.specification
hphp/runtime/base/builtin-functions.cpp
hphp/runtime/base/builtin-functions.h
hphp/runtime/base/comparisons.cpp
hphp/runtime/base/comparisons.h
hphp/runtime/test/simplifier.cpp
hphp/runtime/vm/jit/code-gen-arm.cpp
hphp/runtime/vm/jit/code-gen-x64.cpp
hphp/runtime/vm/jit/code-gen-x64.h
hphp/runtime/vm/jit/dce.cpp
hphp/runtime/vm/jit/gvn.cpp
hphp/runtime/vm/jit/ir-opcode.cpp
hphp/runtime/vm/jit/ir-opcode.h
hphp/runtime/vm/jit/ir-unit.cpp
hphp/runtime/vm/jit/irgen-arith.cpp
hphp/runtime/vm/jit/irgen-builtin.cpp
hphp/runtime/vm/jit/memory-effects.cpp
hphp/runtime/vm/jit/native-calls.cpp
hphp/runtime/vm/jit/simplify.cpp
hphp/runtime/vm/jit/translator-runtime.cpp
hphp/runtime/vm/jit/translator-runtime.h
hphp/test/quick/all_type_comparison_test.php
hphp/test/quick/all_type_comparison_test.php.expect