Skip to content

Commit 6ac4455

Browse files
authored
[SingleSource] Add variants with forced opts for vectorizer tests. (#368)
Add a few variants with different forced options: * tail-folding forced with different modes * instruction costs forced This should increase the test coverage for different option combinations on more platforms (e.g. testing tail-folding even on targets where it is not the default). Hopefully makes it a bit easier to discover miscompiles, e.g. like llvm/llvm-project#182492. PR: #368
1 parent 3fbb3ac commit 6ac4455

1 file changed

Lines changed: 45 additions & 2 deletions

File tree

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,51 @@
1+
set(CMAKE_CXX_STANDARD 17)
12
llvm_singlesource()
2-
set_property(TARGET runtime-checks PROPERTY CXX_STANDARD 17)
3-
set_property(TARGET early-exit PROPERTY CXX_STANDARD 17)
43

54
# The VPlan-native path is specific to llvm.
65
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
76
add_subdirectory(VPlanNativePath)
7+
8+
set(BASE_CXXFLAGS ${CXXFLAGS})
9+
10+
# Add targets for all tests with forced tail folding.
11+
list(APPEND CXXFLAGS
12+
"-mllvm" "-prefer-predicate-over-epilogue=predicate-dont-vectorize"
13+
"-mllvm" "-force-tail-folding-style=data"
14+
)
15+
llvm_singlesource(PREFIX "tfactivelanemask-")
16+
17+
# Add targets for all tests with forced tail folding using data without lane mask.
18+
set(CXXFLAGS ${BASE_CXXFLAGS})
19+
list(APPEND CXXFLAGS
20+
"-mllvm" "-prefer-predicate-over-epilogue=predicate-dont-vectorize"
21+
"-mllvm" "-force-tail-folding-style=data-without-lane-mask"
22+
)
23+
llvm_singlesource(PREFIX "tf-")
24+
25+
# Add targets with instruction cost forced to 1.
26+
set(CXXFLAGS ${BASE_CXXFLAGS})
27+
list(APPEND CXXFLAGS
28+
"-mllvm" "-force-target-instruction-cost=1"
29+
)
30+
llvm_singlesource(PREFIX "ftic-")
31+
32+
# Add targets with instruction cost forced to 1 and forced tail-folding.
33+
set(CXXFLAGS ${BASE_CXXFLAGS})
34+
list(APPEND CXXFLAGS
35+
"-mllvm" "-force-target-instruction-cost=1"
36+
"-mllvm" "-prefer-predicate-over-epilogue=predicate-dont-vectorize"
37+
"-mllvm" "-force-tail-folding-style=data"
38+
)
39+
llvm_singlesource(PREFIX "tfactivelanemask-ftic-")
40+
41+
# Add targets with instruction cost forced to 1 and forced tail-folding without lane mask.
42+
set(CXXFLAGS ${BASE_CXXFLAGS})
43+
list(APPEND CXXFLAGS
44+
"-mllvm" "-force-target-instruction-cost=1"
45+
"-mllvm" "-prefer-predicate-over-epilogue=predicate-dont-vectorize"
46+
"-mllvm" "-force-tail-folding-style=data-without-lane-mask"
47+
)
48+
llvm_singlesource(PREFIX "tf-ftic-")
49+
50+
set(CXXFLAGS ${BASE_CXXFLAGS})
851
endif()

0 commit comments

Comments
 (0)