summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Artem Serov <artem.serov@linaro.org> 2019-12-04 21:02:09 +0000
committer Treehugger Robot <treehugger-gerrit@google.com> 2020-04-14 10:26:59 +0000
commitb47b978486572492140b63b0c8c5daa58dc28d41 (patch)
tree546c065d9396ef25bbd08b02d5ef4f6d269babfc /compiler/optimizing/nodes.h
parente778fa6ead79e9cb26810d484c5a594e9612de9b (diff)
ART: Fix vectorizer HalvingAdd idiom.
IsAddConst2 function tried to extract addition chains for the halving add idiom: (A + B) >> 1. The problem was that regular shift right (x >> 1) was accepted for the idiom (with {A: x, B: 0}) and not processed as a shift - which broke the assumptions on shifts right and operand signedness. This CL fixes that. Test: 646-checker-simd-hadd. Test: test-art-target. Change-Id: Icf71e1a8e8c54e68114d7d5d6c4aa8a47ea5234d
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 7ed5bca947..611e0e734a 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -8121,6 +8121,10 @@ inline HInstruction* HuntForDeclaration(HInstruction* instruction) {
return instruction;
}
+inline bool IsAddOrSub(const HInstruction* instruction) {
+ return instruction->IsAdd() || instruction->IsSub();
+}
+
void RemoveEnvironmentUses(HInstruction* instruction);
bool HasEnvironmentUsedByOthers(HInstruction* instruction);
void ResetEnvironmentInputRecords(HInstruction* instruction);