summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Anton Romanov <anton.romanov@syntacore.com> 2024-09-03 14:43:45 +0300
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-09-10 15:44:02 +0000
commit39927bc359ccbe65371213c4559126b05dcfb117 (patch)
treecfa4f0cf9bdab1c314bb08f83178d02a65ffb881 /compiler/optimizing/graph_checker.cc
parente36cb730c4e87213f648c74ef095152124edfe5f (diff)
riscv64: Add node Rol, fix InstructionBuilder
Add new IR node Rol (rotate left). This allows to generate 1 (one) risc-v instruction from Integer(Long).rotateLeft intrinsic instead of 2 instructions (Ror+Neg). Fix InstructionBuilder: build Rol from rotateLeft instead of Ror+Neg. Add unfolding of Rol node in InstructionSimplifier(Arm, Arm64 and X86 Int64 type) to Neg+Ror. By compiling with dex2oat all the methods of applications below I got: in Facebook 1 Ror+Neg pattern, in Minecraft 5 Ror+Neg patterns. Test: art/test/testrunner/testrunner.py --target --64 --ndebug --optimizing Change-Id: Ic28610c6fab4f66386f2fbc0f7223ef2c0e644b6
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index ad0d0fb2ca..82f98ed5ea 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -1404,7 +1404,7 @@ void GraphChecker::VisitBinaryOperation(HBinaryOperation* op) {
DataType::Type result_type = op->GetType();
// Type consistency between inputs.
- if (op->IsUShr() || op->IsShr() || op->IsShl() || op->IsRor()) {
+ if (op->IsUShr() || op->IsShr() || op->IsShl() || op->IsRol() || op->IsRor()) {
if (DataType::Kind(rhs_type) != DataType::Type::kInt32) {
AddError(StringPrintf("Shift/rotate operation %s %d has a non-int kind second input: "
"%s of type %s.",
@@ -1428,7 +1428,7 @@ void GraphChecker::VisitBinaryOperation(HBinaryOperation* op) {
op->GetId(),
DataType::PrettyDescriptor(result_type)));
}
- } else if (op->IsUShr() || op->IsShr() || op->IsShl() || op->IsRor()) {
+ } else if (op->IsUShr() || op->IsShr() || op->IsShl() || op->IsRol() || op->IsRor()) {
// Only check the first input (value), as the second one (distance)
// must invariably be of kind `int`.
if (result_type != DataType::Kind(lhs_type)) {