diff --git a/llvm/test/Other/opt-pipeline-vector-passes.ll b/llvm/test/Other/opt-pipeline-vector-passes.ll index af702995d5758..fc3a6586d9196 100644 --- a/llvm/test/Other/opt-pipeline-vector-passes.ll +++ b/llvm/test/Other/opt-pipeline-vector-passes.ll @@ -1,6 +1,6 @@ -; RUN: opt -disable-verify -debug-pass-manager -passes='default' -S %s 2>&1 | FileCheck %s --check-prefixes=O1 -; RUN: opt -disable-verify -debug-pass-manager -passes='default' -S %s 2>&1 | FileCheck %s --check-prefixes=O2 -; RUN: opt -disable-verify -debug-pass-manager -passes='default' -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=O2_EXTRA +; RUN: opt -disable-verify -debug-pass-manager -passes='default' -force-vector-width=4 -S %s 2>&1 | FileCheck %s --check-prefixes=O1 +; RUN: opt -disable-verify -debug-pass-manager -passes='default' -force-vector-width=4 -S %s 2>&1 | FileCheck %s --check-prefixes=O2 +; RUN: opt -disable-verify -debug-pass-manager -passes='default' -force-vector-width=4 -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=O2_EXTRA ; REQUIRES: asserts @@ -17,6 +17,8 @@ ; Everything runs at -O2. ; O2-LABEL: Running pass: LoopVectorizePass ; O2: Running pass: SLPVectorizerPass +; O2-NOT: Running pass: EarlyCSEPass +; O2-NOT: Running pass: LICMPass ; O2: Running pass: VectorCombinePass ; Optionally run cleanup passes. @@ -32,14 +34,20 @@ ; O2_EXTRA: Running pass: EarlyCSEPass ; O2_EXTRA: Running pass: VectorCombinePass -define i64 @f(i1 %cond) { +define i64 @f(i1 %cond, i32* %src, i32* %dst) { entry: br label %loop loop: %i = phi i64 [ 0, %entry ], [ %inc, %loop ] - %inc = add i64 %i, 1 - br i1 %cond, label %loop, label %exit + %src.i = getelementptr i32, i32* %src, i64 %i + %src.v = load i32, i32* %src.i + %add = add i32 %src.v, 10 + %dst.i = getelementptr i32, i32* %dst, i64 %i + store i32 %add, i32* %dst.i + %inc = add nuw nsw i64 %i, 1 + %ec = icmp ne i64 %inc, 1000 + br i1 %ec, label %loop, label %exit exit: ret i64 %i