diff options
author | 2024-05-21 14:28:56 +0100 | |
---|---|---|
committer | 2024-05-28 09:14:04 +0000 | |
commit | 1d116a904a41f969b549cac33a4baaf5a123c3ec (patch) | |
tree | aeb6f8944186f9b7e977e1d9c127a0980c3ef06a /compiler/optimizing/loop_optimization.h | |
parent | 6af68f471b6c1f638033f8261a7bfb5b9ad5354d (diff) |
[SVE] Fix a bug with vectorization external set.
This patch fixes a bug when LoopOptimization::vector_external_set_
(contains vector instructions to be inserted outside of newly
generated loops) was reset more than once during vectorization. Instead,
it should only be reset when vectorization of the loop has finished.
It also adds a regression test for the situation: a loop is vectorized
in predicated mode and a disambiguation test and a back-up scalar loop
are needed and inserted.
Note: This bug only affected predicated vectorization (e.g. using Arm
SVE) and didn't impact any production devices.
Test: run with ART_FORCE_TRY_PREDICATED_SIMD=true and without
Test: 623-checker-loop-regressions
Test: ./art/test.py --host --optimizing --jit
Test: ./art/test.py --target --optimizing --jit
Change-Id: I19fabd4d7034e5aa6421df79b2519d8f7e6ef43a
Diffstat (limited to 'compiler/optimizing/loop_optimization.h')
-rw-r--r-- | compiler/optimizing/loop_optimization.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index 4817060dfa..b6998c7f90 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -480,6 +480,7 @@ class HLoopOptimization : public HOptimization { bool CanRemoveCycle(); // Whether the current 'iset_' is removable. bool IsInPredicatedVectorizationMode() const { return predicated_vectorization_mode_; } + void MaybeInsertInVectorExternalSet(HInstruction* instruction); // Compiler options (to query ISA features). const CompilerOptions* compiler_options_; @@ -547,6 +548,12 @@ class HLoopOptimization : public HOptimization { // 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). + // + // The instructions in the set are live for the whole vectorization process of the current + // loop, not just during generation of a particular loop version (as the sets above). + // + // Currently the set is being only used in the predicated mode - for assigning governing + // predicates. ScopedArenaSet<HInstruction*>* vector_external_set_; // A mapping between a basic block of the original loop and its associated PredicateInfo. |