Add specialized string comparison IR ops
commit54c7c88277f3044c8675565ef6a6bfd7ffcef5f7
authorRick Lavoie <rlavoie@fb.com>
Wed, 1 Jul 2015 18:42:58 +0000 (1 11:42 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Wed, 1 Jul 2015 19:02:51 +0000 (1 12:02 -0700)
tree30f46becfac8bb48f187547e8e08e69d0b592779
parent33b231369d0a939195469001644220eea9df6138
Add specialized string comparison IR ops

Summary: Add new IR ops for string comparisons, EqStr, NeqStr, EqualStr,
NEqualStr, GtStr, GteStr, LtStr, LteStr. These ops have the same semantics as
the generic comparison ops with string operands. Teach the simplifier to convert
any generic comparison ops with string operands to the string-specific
ones. Note that previously the generic comparison ops (except Eq, Neq, Same, and
NSame) were never actually used for strings, as we punted during IR generation
for them. They are now fully supported.

This is a step towards migrating over to specialized comparison ops
completely, removing the need for the generic ops.

Reviewed By: @edwinsmith

Differential Revision: D2084084
14 files changed:
hphp/doc/ir.specification
hphp/runtime/base/comparisons.h
hphp/runtime/vm/jit/code-gen-arm.cpp
hphp/runtime/vm/jit/code-gen-x64.cpp
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/irgen-arith.cpp
hphp/runtime/vm/jit/memory-effects.cpp
hphp/runtime/vm/jit/native-calls.cpp
hphp/runtime/vm/jit/simplify.cpp
hphp/test/quick/all_type_comparison_test.php
hphp/test/quick/all_type_comparison_test.php.expect