Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Other/opt-pipeline-vector-passes.ll
; RUN: opt -disable-verify -debug-pass-manager -passes='default<O1>' -S %s 2>&1 | FileCheck %s --check-prefixes=O1 | ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O1>' -force-vector-width=4 -S %s 2>&1 | FileCheck %s --check-prefixes=O1 | ||||
; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -S %s 2>&1 | FileCheck %s --check-prefixes=O2 | ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -force-vector-width=4 -S %s 2>&1 | FileCheck %s --check-prefixes=O2 | ||||
; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=O2_EXTRA | ; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -force-vector-width=0 -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=O2 | ||||
aeubanks: this should check that we actually don't run the extra passes when there's no vectorization, e. | |||||
fhahnAuthorUnsubmitted Yes, the original test doesn't really check for that. I'll push a commit to improve the test in that regard separately and will also include the vector loop. fhahn: Yes, the original test doesn't really check for that. I'll push a commit to improve the test in… | |||||
; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -force-vector-width=4 -extra-vectorizer-passes -S %s 2>&1 | FileCheck %s --check-prefixes=O2_EXTRA | |||||
; REQUIRES: asserts | ; REQUIRES: asserts | ||||
; The loop vectorizer still runs at both -O1/-O2 even with the | ; The loop vectorizer still runs at both -O1/-O2 even with the | ||||
; debug flag, but it only works on loops explicitly annotated | ; debug flag, but it only works on loops explicitly annotated | ||||
; with pragmas. | ; with pragmas. | ||||
; SLP does not run at -O1. Loop vectorization runs, but it only | ; SLP does not run at -O1. Loop vectorization runs, but it only | ||||
Show All 15 Lines | |||||
; O2_EXTRA: Running pass: LICMPass | ; O2_EXTRA: Running pass: LICMPass | ||||
; O2_EXTRA: Running pass: SimpleLoopUnswitchPass | ; O2_EXTRA: Running pass: SimpleLoopUnswitchPass | ||||
; O2_EXTRA: Running pass: SimplifyCFGPass | ; O2_EXTRA: Running pass: SimplifyCFGPass | ||||
; O2_EXTRA: Running pass: InstCombinePass | ; O2_EXTRA: Running pass: InstCombinePass | ||||
; O2_EXTRA: Running pass: SLPVectorizerPass | ; O2_EXTRA: Running pass: SLPVectorizerPass | ||||
; O2_EXTRA: Running pass: EarlyCSEPass | ; O2_EXTRA: Running pass: EarlyCSEPass | ||||
; O2_EXTRA: Running pass: VectorCombinePass | ; O2_EXTRA: Running pass: VectorCombinePass | ||||
define i64 @f(i1 %cond) { | define i64 @f(i1 %cond, i32* %src, i32* %dst) { | ||||
entry: | entry: | ||||
br label %loop | br label %loop | ||||
loop: | loop: | ||||
%i = phi i64 [ 0, %entry ], [ %inc, %loop ] | %i = phi i64 [ 0, %entry ], [ %inc, %loop ] | ||||
%inc = add i64 %i, 1 | %src.i = getelementptr i32, i32* %src, i64 %i | ||||
br i1 %cond, label %loop, label %exit | %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: | exit: | ||||
ret i64 %i | ret i64 %i | ||||
} | } |
this should check that we actually don't run the extra passes when there's no vectorization, e.g.
O2-NOT: Running pass: ...