summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_simplifier_arm64.h
diff options
context:
space:
mode:
author Alexandre Rames <alexandre.rames@linaro.org> 2015-11-25 16:28:08 +0000
committer Alexandre Rames <alexandre.rames@linaro.org> 2015-11-25 16:28:08 +0000
commit8626b741716390a0119ffeb88b5b9fcf08e13010 (patch)
tree28d261dbb8fa3018cba8a5d829319604508ea0a1 /compiler/optimizing/instruction_simplifier_arm64.h
parent0c32fdeaeda2a1e388e280da12662d1d18c834a2 (diff)
ARM64: Use the shifter operands.
This introduces architecture-specific instruction simplification. On ARM64 we try to merge shifts and sign-extension operations into arithmetic and logical instructions. For example for the Java code int res = a + (b << 5); we would generate lsl w3, w2, #5 add w0, w1, w3 and we now generate add w0, w1, w2, lsl #5 Change-Id: Ic03bdff44a1c12e21ddff1b0513bd32a730742b7
Diffstat (limited to 'compiler/optimizing/instruction_simplifier_arm64.h')
-rw-r--r--compiler/optimizing/instruction_simplifier_arm64.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/instruction_simplifier_arm64.h b/compiler/optimizing/instruction_simplifier_arm64.h
index eed2276588..b7f490bb8c 100644
--- a/compiler/optimizing/instruction_simplifier_arm64.h
+++ b/compiler/optimizing/instruction_simplifier_arm64.h
@@ -39,6 +39,17 @@ class InstructionSimplifierArm64Visitor : public HGraphVisitor {
HInstruction* array,
HInstruction* index,
int access_size);
+ bool TryMergeIntoUsersShifterOperand(HInstruction* instruction);
+ bool TryMergeIntoShifterOperand(HInstruction* use,
+ HInstruction* bitfield_op,
+ bool do_merge);
+ bool CanMergeIntoShifterOperand(HInstruction* use, HInstruction* bitfield_op) {
+ return TryMergeIntoShifterOperand(use, bitfield_op, false);
+ }
+ bool MergeIntoShifterOperand(HInstruction* use, HInstruction* bitfield_op) {
+ DCHECK(CanMergeIntoShifterOperand(use, bitfield_op));
+ return TryMergeIntoShifterOperand(use, bitfield_op, true);
+ }
bool TrySimpleMultiplyAccumulatePatterns(HMul* mul,
HBinaryOperation* input_binop,
@@ -48,6 +59,10 @@ class InstructionSimplifierArm64Visitor : public HGraphVisitor {
void VisitArrayGet(HArrayGet* instruction) OVERRIDE;
void VisitArraySet(HArraySet* instruction) OVERRIDE;
void VisitMul(HMul* instruction) OVERRIDE;
+ void VisitShl(HShl* instruction) OVERRIDE;
+ void VisitShr(HShr* instruction) OVERRIDE;
+ void VisitTypeConversion(HTypeConversion* instruction) OVERRIDE;
+ void VisitUShr(HUShr* instruction) OVERRIDE;
OptimizingCompilerStats* stats_;
};