summaryrefslogtreecommitdiff
path: root/compiler/optimizing/loop_optimization.h
diff options
context:
space:
mode:
author Artem Serov <artem.serov@arm.com> 2022-09-13 23:05:17 +0100
committer Santiago Aboy Solanes <solanes@google.com> 2023-06-09 15:41:40 +0000
commita3610a1a121e2ec2b4130dba3b9878fab3cfd192 (patch)
tree9547ff225ef7fea6d8aee14d6efc2574693b00da /compiler/optimizing/loop_optimization.h
parentfbf26acf186d4809045652a4d21996913c04388f (diff)
Refactor vectorization data flow methods.
As part of vectorization some instructions are inserted outside the loop (preheader, exit); in predicated mode they must be assigned a governing predicate. Currently the corresponding data flow analysis and generation methods have multiple patchy 'InPredicatedMode()' guarded actions for this. This patch introduces vector_external_set_ to track such instructions; in predicated mode it updates the governing predicates separately using that set, making the methods agnostic to vectorization type - predicated or traditional. It also properly guards ArrayCharAt case for predicated mode via vector restrictions and renames a few variables for better readability. Original author: Artem Serov <Artem.Serov@linaro.org> Test: ./art/test/testrunner/testrunner.py --host --optimizing --jit Test: ./art/test/testrunner/testrunner.py --target --optimizing --jit Test: target tests on arm64 with SVE (for details see art/test/README.arm_fvp). Change-Id: I7fba731e6f4e8dd5cd4490cdfc95cb4ae8b2e99e
Diffstat (limited to 'compiler/optimizing/loop_optimization.h')
-rw-r--r--compiler/optimizing/loop_optimization.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h
index 6dd778ba74..27afc07f4e 100644
--- a/compiler/optimizing/loop_optimization.h
+++ b/compiler/optimizing/loop_optimization.h
@@ -369,6 +369,11 @@ class HLoopOptimization : public HOptimization {
// Contents reside in phase-local heap memory.
ScopedArenaSafeMap<HInstruction*, HInstruction*>* vector_permanent_map_;
+ // Tracks vector operations that are inserted outside of the loop (preheader, exit)
+ // as part of vectorization (e.g. replicate scalar for loop invariants and reduce ops
+ // for loop reductions).
+ ScopedArenaSet<HInstruction*>* vector_external_set_;
+
// Temporary vectorization bookkeeping.
VectorMode vector_mode_; // synthesis mode
HBasicBlock* vector_preheader_; // preheader of the new loop