Skip to content

Commit dbb4af0

Browse files
committed
[LV] Enable auto-vectorisation of loops with uncountable exits
Until now the feature to enable vectorisation of some early exit loops with uncountable exits was controlled under a flag, off by default. Now that we have efficient code generation for vectorising such loops (see PR llvm#130766) and we are still far enough away from the next LLVM release it seems like a good time to enable the feature by default. If any issues arise post-commit it can be easily reverted. Using this patch I built and ran the LLVM test suite successfully, which on neoverse-v1 led to the vectorisation of 114 additional early exit loops. I then performed a bootstrap build of clang, which built cleanly with 64 extra early exit loops vectorising. I also built and ran SPEC2017 successfully with no change in performance for both neoverse-v1 and neoverse-v2.
1 parent 4775e6d commit dbb4af0

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static cl::opt<bool> UseWiderVFIfCallVariantsPresent(
396396
cl::desc("Try wider VFs if they enable the use of vector variants"));
397397

398398
static cl::opt<bool> EnableEarlyExitVectorization(
399-
"enable-early-exit-vectorization", cl::init(false), cl::Hidden,
399+
"enable-early-exit-vectorization", cl::init(true), cl::Hidden,
400400
cl::desc(
401401
"Enable vectorization of early exit loops with uncountable exits."));
402402

llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2-
; RUN: opt -S < %s -p loop-vectorize -enable-early-exit-vectorization | FileCheck %s --check-prefixes=CHECK
2+
; RUN: opt -S < %s -p loop-vectorize | FileCheck %s --check-prefixes=CHECK
33

44
target triple = "aarch64-unknown-linux-gnu"
55

llvm/test/Transforms/LoopVectorize/multi_early_exit.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2-
; RUN: opt -S < %s -p loop-vectorize -enable-early-exit-vectorization | FileCheck %s
2+
; RUN: opt -S < %s -p loop-vectorize | FileCheck %s
33

44
declare void @init_mem(ptr, i64);
55

llvm/test/Transforms/LoopVectorize/multi_early_exit_live_outs.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2-
; RUN: opt -S < %s -p loop-vectorize -enable-early-exit-vectorization | FileCheck %s
2+
; RUN: opt -S < %s -p loop-vectorize | FileCheck %s
33

44
declare void @init_mem(ptr, i64);
55

llvm/test/Transforms/LoopVectorize/single_early_exit.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2-
; RUN: opt -S < %s -p loop-vectorize -enable-early-exit-vectorization -force-vector-width=4 | FileCheck %s
2+
; RUN: opt -S < %s -p loop-vectorize -force-vector-width=4 | FileCheck %s
33

44
declare void @init_mem(ptr, i64);
55

llvm/test/Transforms/LoopVectorize/single_early_exit_live_outs.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2-
; RUN: opt -S < %s -p loop-vectorize -enable-early-exit-vectorization -force-vector-width=4 | FileCheck %s
2+
; RUN: opt -S < %s -p loop-vectorize -force-vector-width=4 | FileCheck %s
33

44
declare void @init_mem(ptr, i64);
55

llvm/test/Transforms/LoopVectorize/single_early_exit_with_outer_loop.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S < %s -p loop-vectorize,'print<loops>' -disable-output -enable-early-exit-vectorization 2>&1 | FileCheck %s
1+
; RUN: opt -S < %s -p loop-vectorize,'print<loops>' -disable-output 2>&1 | FileCheck %s
22

33
declare void @init_mem(ptr, i64);
44

0 commit comments

Comments
 (0)