2011-04-29 14:27:02 +08:00
|
|
|
set(LLVM_NO_RTTI 1)
|
|
|
|
|
2014-03-04 03:30:19 +08:00
|
|
|
set(ISL_CODEGEN_FILES
|
|
|
|
CodeGen/IslAst.cpp
|
2014-07-30 04:50:09 +08:00
|
|
|
CodeGen/IslExprBuilder.cpp
|
2015-04-27 20:32:24 +08:00
|
|
|
CodeGen/IslNodeBuilder.cpp
|
2015-05-12 15:45:52 +08:00
|
|
|
CodeGen/CodeGeneration.cpp)
|
2014-03-04 03:30:19 +08:00
|
|
|
|
|
|
|
if (GPU_CODEGEN)
|
2016-07-13 23:54:58 +08:00
|
|
|
set (GPGPU_CODEGEN_FILES
|
|
|
|
CodeGen/PPCGCodeGeneration.cpp
|
2017-08-09 20:59:23 +08:00
|
|
|
CodeGen/ManagedMemoryRewrite.cpp
|
2016-07-13 23:54:58 +08:00
|
|
|
)
|
2014-03-04 03:30:19 +08:00
|
|
|
endif (GPU_CODEGEN)
|
2011-04-29 14:27:02 +08:00
|
|
|
|
2015-09-24 19:30:22 +08:00
|
|
|
# Compile ISL into a separate library.
|
|
|
|
add_subdirectory(External)
|
2015-02-05 04:55:43 +08:00
|
|
|
|
2015-09-11 17:01:55 +08:00
|
|
|
set(POLLY_HEADER_FILES)
|
|
|
|
if (MSVC_IDE OR XCODE)
|
|
|
|
file(GLOB_RECURSE POLLY_HEADER_FILES "${POLLY_SOURCE_DIR}/include/polly/*.h")
|
|
|
|
endif ()
|
2015-02-05 04:55:43 +08:00
|
|
|
|
2020-04-18 14:14:52 +08:00
|
|
|
set(POLLY_COMPONENTS
|
|
|
|
Support
|
|
|
|
Core
|
|
|
|
ScalarOpts
|
|
|
|
InstCombine
|
|
|
|
TransformUtils
|
|
|
|
Analysis
|
|
|
|
ipo
|
|
|
|
MC
|
|
|
|
Passes
|
|
|
|
Linker
|
|
|
|
IRReader
|
|
|
|
Analysis
|
|
|
|
# The libraries below are required for darwin: http://PR26392
|
|
|
|
BitReader
|
|
|
|
MCParser
|
|
|
|
Object
|
|
|
|
ProfileData
|
|
|
|
Target
|
|
|
|
Vectorize
|
|
|
|
)
|
|
|
|
|
|
|
|
# Polly-ACC requires the NVPTX backend to work. Ask LLVM about its libraries.
|
|
|
|
if (GPU_CODEGEN)
|
|
|
|
# This call emits an error if they NVPTX backend is not enable.
|
|
|
|
list(APPEND POLLY_COMPONENTS NVPTX)
|
|
|
|
endif ()
|
|
|
|
|
2017-04-28 00:13:03 +08:00
|
|
|
# Use an object-library to add the same files to multiple libs without requiring
|
|
|
|
# the sources them to be recompiled for each of them.
|
2019-06-08 23:37:47 +08:00
|
|
|
add_llvm_pass_plugin(Polly
|
2020-01-10 17:05:30 +08:00
|
|
|
NO_MODULE
|
2020-02-25 01:51:00 +08:00
|
|
|
SUBPROJECT Polly
|
2015-03-05 06:43:40 +08:00
|
|
|
Analysis/DependenceInfo.cpp
|
2016-07-25 20:48:45 +08:00
|
|
|
Analysis/PolyhedralInfo.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Analysis/ScopDetection.cpp
|
2014-05-24 17:24:53 +08:00
|
|
|
Analysis/ScopDetectionDiagnostic.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Analysis/ScopInfo.cpp
|
2016-06-28 09:37:20 +08:00
|
|
|
Analysis/ScopBuilder.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Analysis/ScopGraphPrinter.cpp
|
|
|
|
Analysis/ScopPass.cpp
|
2017-03-17 21:09:52 +08:00
|
|
|
Analysis/PruneUnprofitable.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
CodeGen/BlockGenerators.cpp
|
|
|
|
${ISL_CODEGEN_FILES}
|
|
|
|
CodeGen/LoopGenerators.cpp
|
2019-03-19 11:18:21 +08:00
|
|
|
CodeGen/LoopGeneratorsGOMP.cpp
|
|
|
|
CodeGen/LoopGeneratorsKMP.cpp
|
2014-03-04 22:59:00 +08:00
|
|
|
CodeGen/IRBuilder.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
CodeGen/Utils.cpp
|
2014-07-26 01:49:55 +08:00
|
|
|
CodeGen/RuntimeDebugBuilder.cpp
|
2015-11-26 20:36:25 +08:00
|
|
|
CodeGen/CodegenCleanup.cpp
|
2017-04-03 22:55:37 +08:00
|
|
|
CodeGen/PerfMonitor.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
${GPGPU_CODEGEN_FILES}
|
2014-03-12 05:25:59 +08:00
|
|
|
Exchange/JSONExporter.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Support/GICHelper.cpp
|
2015-08-12 18:19:50 +08:00
|
|
|
Support/SCEVAffinator.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Support/SCEVValidator.cpp
|
2014-03-12 05:26:06 +08:00
|
|
|
Support/RegisterPasses.cpp
|
2014-03-04 03:30:19 +08:00
|
|
|
Support/ScopHelper.cpp
|
2015-05-03 13:21:36 +08:00
|
|
|
Support/ScopLocation.cpp
|
2017-01-28 06:51:36 +08:00
|
|
|
Support/ISLTools.cpp
|
2017-03-10 06:29:58 +08:00
|
|
|
Support/DumpModulePass.cpp
|
2017-05-04 23:22:57 +08:00
|
|
|
Support/VirtualInstruction.cpp
|
2014-03-12 05:25:59 +08:00
|
|
|
Transform/Canonicalization.cpp
|
|
|
|
Transform/CodePreparation.cpp
|
|
|
|
Transform/DeadCodeElimination.cpp
|
|
|
|
Transform/ScheduleOptimizer.cpp
|
2019-06-01 03:26:57 +08:00
|
|
|
Transform/ScheduleTreeTransform.cpp
|
Add -polly-flatten-schedule pass.
The -polly-flatten-schedule pass reduces the number of scattering
dimensions in its isl_union_map form to make them easier to understand.
It is not meant to be used in production, only for debugging and
regression tests.
To illustrate, how it can make sets simpler, here is a lifetime set
used computed by the porposed DeLICM pass without flattening:
{ Stmt_reduction_for[0, 4] -> [0, 2, o2, o3] : o2 < 0;
Stmt_reduction_for[0, 4] -> [0, 1, o2, o3] : o2 >= 5;
Stmt_reduction_for[0, 4] -> [0, 1, 4, o3] : o3 > 0;
Stmt_reduction_for[0, i1] -> [0, 1, i1, 1] : 0 <= i1 <= 3;
Stmt_reduction_for[0, 4] -> [0, 2, 0, o3] : o3 <= 0 }
And here the same lifetime for a semantically identical one-dimensional
schedule:
{ Stmt_reduction_for[0, i1] -> [2 + 3i1] : 0 <= i1 <= 4 }
Differential Revision: https://reviews.llvm.org/D24310
llvm-svn: 280948
2016-09-08 23:02:36 +08:00
|
|
|
Transform/FlattenSchedule.cpp
|
|
|
|
Transform/FlattenAlgo.cpp
|
2017-07-22 22:02:47 +08:00
|
|
|
Transform/ForwardOpTree.cpp
|
2016-11-30 00:41:21 +08:00
|
|
|
Transform/DeLICM.cpp
|
2017-08-05 06:51:23 +08:00
|
|
|
Transform/ZoneAlgo.cpp
|
2017-03-11 00:05:24 +08:00
|
|
|
Transform/Simplify.cpp
|
2017-08-08 04:54:20 +08:00
|
|
|
Transform/MaximalStaticExpansion.cpp
|
Add rewrite by-reference parameter pass
Summary:
This pass detangles induction variables from functions, which take variables by
reference. Most fortran functions compiled with gfortran pass variables by
reference. Unfortunately a common pattern, printf calls of induction variables,
prevent in this situation the promotion of the induction variable to a register,
which again inhibits any kind of loop analysis. To work around this issue
we developed a specialized pass which introduces separate alloca slots for
known-read-only references, which indicate the mem2reg pass that the induction
variables can be promoted to registers and consquently enable SCEV to work.
We currently hardcode the information that a function
_gfortran_transfer_integer_write does not read its second parameter, as
dragonegg does not add the right annotations and we cannot change old dragonegg
releases. Hopefully flang will produce the right annotations.
Reviewers: Meinersbur, bollu, singam-sanjay
Reviewed By: bollu
Subscribers: mgorny, pollydev, llvm-commits
Tags: #polly
Differential Revision: https://reviews.llvm.org/D36800
llvm-svn: 311066
2017-08-17 13:25:08 +08:00
|
|
|
Transform/RewriteByReferenceParameters.cpp
|
2017-08-18 05:57:23 +08:00
|
|
|
Transform/ScopInliner.cpp
|
2021-03-16 01:13:21 +08:00
|
|
|
Transform/ManualOptimizer.cpp
|
2021-06-05 12:17:41 +08:00
|
|
|
Transform/MatmulOptimizer.cpp
|
2015-09-11 17:01:55 +08:00
|
|
|
${POLLY_HEADER_FILES}
|
2020-04-18 14:14:52 +08:00
|
|
|
|
|
|
|
LINK_COMPONENTS
|
|
|
|
${POLLY_COMPONENTS}
|
2011-04-29 14:27:02 +08:00
|
|
|
)
|
2019-06-08 23:37:47 +08:00
|
|
|
set_target_properties(obj.Polly PROPERTIES FOLDER "Polly")
|
|
|
|
set_target_properties(Polly PROPERTIES FOLDER "Polly")
|
2011-04-29 14:27:02 +08:00
|
|
|
|
2020-01-08 04:15:07 +08:00
|
|
|
if (MSVC_IDE OR XCODE)
|
|
|
|
# Configure source groups for Polly source files. By default, in the IDE there
|
|
|
|
# will be a source and include folder. In the source folder will be all the
|
|
|
|
# source files in a flat list, and in the include folder will be all the
|
|
|
|
# headers in a flat list. Sets the CMake source_group for each folder such
|
|
|
|
# the organization of the sources and headers in the IDE matches how it is
|
|
|
|
# laid out on disk
|
|
|
|
setup_polly_source_groups(${CMAKE_CURRENT_LIST_DIR}
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/../include/polly)
|
|
|
|
endif()
|
|
|
|
|
2017-04-28 00:13:03 +08:00
|
|
|
# Create the library that can be linked into LLVM's tools and Polly's unittests.
|
|
|
|
# It depends on all library it needs, such that with
|
|
|
|
# LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as
|
|
|
|
# well.
|
2018-01-13 00:09:18 +08:00
|
|
|
target_link_libraries(Polly PUBLIC
|
2017-04-28 00:13:03 +08:00
|
|
|
${ISL_TARGET}
|
|
|
|
)
|
|
|
|
|
|
|
|
# Additional dependencies for Polly-ACC.
|
2016-07-13 23:54:47 +08:00
|
|
|
if (GPU_CODEGEN)
|
2018-01-13 00:09:18 +08:00
|
|
|
target_link_libraries(Polly PUBLIC PollyPPCG)
|
2017-04-28 00:13:03 +08:00
|
|
|
endif ()
|
2016-07-13 23:54:47 +08:00
|
|
|
|
2020-04-18 14:14:52 +08:00
|
|
|
if (NOT LLVM_LINK_LLVM_DYLIB AND NOT LLVM_POLLY_LINK_INTO_TOOLS)
|
2019-06-08 23:37:47 +08:00
|
|
|
# Polly-ACC requires the NVPTX target to be present in the executable it is linked to
|
|
|
|
set_property(TARGET bugpoint APPEND PROPERTY LINK_LIBRARIES LLVMTarget)
|
2017-04-28 00:13:03 +08:00
|
|
|
endif ()
|
2015-02-12 16:27:19 +08:00
|
|
|
|
2017-04-28 00:13:03 +08:00
|
|
|
# Create a loadable module Polly.so that can be loaded using
|
|
|
|
# LLVM's/clang's "-load" option.
|
2020-09-15 14:12:02 +08:00
|
|
|
if (WIN32 OR NOT LLVM_ENABLE_PIC)
|
2020-08-27 16:59:51 +08:00
|
|
|
# Add dummy target, either because loadable modules are not supported
|
|
|
|
# as on Windows or because PIC code has been disabled
|
2015-07-21 20:29:02 +08:00
|
|
|
add_custom_target(LLVMPolly)
|
2015-07-21 20:40:01 +08:00
|
|
|
set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
|
2015-07-21 20:29:02 +08:00
|
|
|
else ()
|
|
|
|
add_polly_loadable_module(LLVMPolly
|
2019-06-08 23:37:47 +08:00
|
|
|
Plugin/Polly.cpp
|
|
|
|
$<TARGET_OBJECTS:obj.Polly>
|
2015-07-21 20:29:02 +08:00
|
|
|
)
|
|
|
|
|
2017-04-28 00:13:03 +08:00
|
|
|
# Only add the dependencies that are not part of LLVM. The latter are assumed
|
|
|
|
# to be already available in the address space the module is loaded into.
|
|
|
|
# Adding them once more would have the effect that both copies try to register
|
|
|
|
# the same command line options, to which LLVM reacts with an error.
|
|
|
|
# If Polly-ACC is enabled, the NVPTX target is also expected to reside in the
|
|
|
|
# hosts. This is not the case for bugpoint. Use LLVM_POLLY_LINK_INTO_TOOLS=ON
|
|
|
|
# instead which will automatically resolve the additional dependencies by
|
|
|
|
# Polly.
|
2018-08-01 08:15:16 +08:00
|
|
|
target_link_libraries(LLVMPolly PUBLIC ${ISL_TARGET})
|
2017-04-28 00:13:03 +08:00
|
|
|
if (GPU_CODEGEN)
|
2018-01-13 00:09:18 +08:00
|
|
|
target_link_libraries(LLVMPolly PUBLIC PollyPPCG)
|
2017-04-28 00:13:03 +08:00
|
|
|
endif ()
|
2015-07-21 20:29:02 +08:00
|
|
|
|
|
|
|
set_target_properties(LLVMPolly
|
|
|
|
PROPERTIES
|
|
|
|
LINKER_LANGUAGE CXX
|
|
|
|
PREFIX "")
|
|
|
|
endif ()
|
2014-03-04 03:30:19 +08:00
|
|
|
|
2012-09-04 16:19:12 +08:00
|
|
|
if (TARGET intrinsics_gen)
|
|
|
|
# Check if we are building as part of an LLVM build
|
2019-06-08 23:37:47 +08:00
|
|
|
add_dependencies(obj.Polly intrinsics_gen)
|
2012-09-04 16:19:12 +08:00
|
|
|
endif()
|