Skip to content

Commit

Permalink
[Polly] Remove Polly-ACC.
Browse files Browse the repository at this point in the history
Polly-ACC is unmaintained and since it has never been ported to the NPM pipeline, since D136621 it is not even accessible anymore without manually specifying the passes on the `opt` command line.

Since there is no plan to put it to a maintainable state, remove it from Polly.

Reviewed By: grosser

Differential Revision: https://reviews.llvm.org/D142580
  • Loading branch information
Meinersbur committed Mar 8, 2023
1 parent 115c7be commit 19afbfe
Show file tree
Hide file tree
Showing 166 changed files with 29 additions and 31,394 deletions.
26 changes: 0 additions & 26 deletions polly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,6 @@ endif ()

SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

option(POLLY_ENABLE_GPGPU_CODEGEN "Enable GPGPU code generation feature" OFF)
set(GPU_CODEGEN FALSE)
if (POLLY_ENABLE_GPGPU_CODEGEN)
# Do not require CUDA/OpenCL, as GPU code generation test cases can be run
# without a CUDA/OpenCL library.
if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
FIND_PACKAGE(CUDA)
FIND_PACKAGE(OpenCL)
set(GPU_CODEGEN TRUE)
else()
message(WARNING "The LLVM NVPTX target is required for GPU code generation")
endif()
endif(POLLY_ENABLE_GPGPU_CODEGEN)


# Support GPGPU code generation if the library is available.
if (CUDA_FOUND)
add_definitions(-DHAS_LIBCUDART)
INCLUDE_DIRECTORIES( ${CUDA_INCLUDE_DIRS} )
endif(CUDA_FOUND)
if (OpenCL_FOUND)
add_definitions(-DHAS_LIBOPENCL)
INCLUDE_DIRECTORIES( ${OpenCL_INCLUDE_DIR} )
endif(OpenCL_FOUND)

option(POLLY_BUNDLED_ISL "Use the bundled version of libisl included in Polly" ON)
if (NOT POLLY_BUNDLED_ISL)
find_package(ISL MODULE REQUIRED)
Expand Down Expand Up @@ -155,7 +130,6 @@ add_subdirectory(test)
if (POLLY_GTEST_AVAIL)
add_subdirectory(unittests)
endif ()
add_subdirectory(tools)
add_subdirectory(cmake)
# TODO: docs.

Expand Down
3 changes: 0 additions & 3 deletions polly/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ if (NOT WIN32 AND LLVM_ENABLE_PIC)
# LLVMPolly is a dummy target on Win or if PIC code is disabled.
list(APPEND POLLY_CONFIG_EXPORTED_TARGETS LLVMPolly)
endif()
if (POLLY_ENABLE_GPGPU_CODEGEN)
list(APPEND POLLY_CONFIG_EXPORTED_TARGETS PollyPPCG)
endif()

# Get the target type for every exported target
foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS)
Expand Down
9 changes: 0 additions & 9 deletions polly/cmake/PollyConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ find_package(LLVM ${LLVM_VERSION} EXACT REQUIRED CONFIG

set(Polly_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(Polly_BUNDLED_ISL @POLLY_BUNDLED_ISL@)
set(Polly_ENABLE_GPGPU_CODEGEN @POLLY_ENABLE_GPGPU_CODEGEN@)

set(Polly_DEFINITIONS ${LLVM_DEFINITIONS})
set(Polly_INCLUDE_DIRS @POLLY_CONFIG_INCLUDE_DIRS@ ${LLVM_INCLUDE_DIRS})
Expand All @@ -19,17 +18,9 @@ set(Polly_LIBRARIES ${LLVM_LIBRARIES} ${Polly_EXPORTED_TARGETS})
# Imported Targets:
@ISL_CONFIG_CODE@

if (Polly_ENABLE_GPGPU_CODEGEN AND NOT TARGET PollyPPCG)
add_library(PollyPPCG @POLLY_CONFIG_TARGET_PollyPPCG_TYPE@ IMPORTED)
set_property(TARGET PollyPPCG PROPERTY INTERFACE_LINK_LIBRARIES @ISL_TARGET@)
endif()

if (NOT TARGET Polly)
add_library(Polly @POLLY_CONFIG_TARGET_Polly_TYPE@ IMPORTED)
set_property(TARGET Polly PROPERTY INTERFACE_LINK_LIBRARIES @ISL_TARGET@)
if (Polly_ENABLE_GPGPU_CODEGEN)
set_property(TARGET Polly APPEND PROPERTY INTERFACE_LINK_LIBRARIES PollyPPCG)
endif()
endif()

if (NOT TARGET LLVMPolly)
Expand Down
2 changes: 2 additions & 0 deletions polly/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ In Polly |version| the following important changes have been incorporated.
In the future we hope that Polly can collaborate better with LoopVectorize,
like Polly marking a loop is safe to vectorize with a specific simd width,
instead of replicating its functionality.

- Polly-ACC has been removed.
33 changes: 0 additions & 33 deletions polly/include/polly/CodeGen/PPCGCodeGeneration.h

This file was deleted.

65 changes: 12 additions & 53 deletions polly/include/polly/CodeGen/RuntimeDebugBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,20 @@ namespace polly {
struct RuntimeDebugBuilder {

/// Generate a constant string into the builder's llvm::Module which can be
/// passed to createGPUPrinter() or createGPUPrinter().
/// passed to createCPUPrinter().
///
/// @param Builder The builder used to emit the printer calls.
/// @param Str The string to be printed.

/// @return A global containing @p Str.
static llvm::Value *getPrintableString(PollyIRBuilder &Builder,
llvm::StringRef Str) {
// TODO: Get rid of magic number 4. It it NVPTX's constant address space and
// works on X86 (CPU) only because its backend ignores the address space.
return Builder.CreateGlobalStringPtr(Str, "", 4);
}
llvm::StringRef Str);

/// Return whether an llvm::Value of the type @p Ty is printable for
/// debugging.
///
/// That is, whether such a value can be passed to createGPUPrinter() or
/// createGPUPrinter() to be dumped as runtime. If false is returned, those
/// That is, whether such a value can be passed to createGPUPrinter()
/// to be dumped as runtime. If false is returned, those
/// functions will fail.
static bool isPrintable(llvm::Type *Ty);

Expand All @@ -64,62 +60,41 @@ struct RuntimeDebugBuilder {
template <typename... Args>
static void createCPUPrinter(PollyIRBuilder &Builder, Args... args) {
std::vector<llvm::Value *> Vector;
createPrinter(Builder, /* CPU */ false, Vector, args...);
}

/// Print a set of LLVM-IR Values or StringRefs on an NVIDIA GPU.
///
/// This function emits a call to vprintf that will print the given
/// arguments from within a kernel thread. It is useful for debugging
/// CUDA program kernels. All arguments given in this list will be
/// automatically concatenated and the resulting string will be printed
/// atomically. We also support ArrayRef arguments, which can be used to
/// provide for example a list of thread-id values.
///
/// @param Builder The builder used to emit the printer calls.
/// @param Args The list of values to print.
template <typename... Args>
static void createGPUPrinter(PollyIRBuilder &Builder, Args... args) {
std::vector<llvm::Value *> Vector;
createPrinter(Builder, /* GPU */ true, Vector, args...);
createPrinter(Builder, Vector, args...);
}

private:
/// Handle Values.
template <typename... Args>
static void createPrinter(PollyIRBuilder &Builder, bool UseGPU,
static void createPrinter(PollyIRBuilder &Builder,
std::vector<llvm::Value *> &Values,
llvm::Value *Value, Args... args) {
Values.push_back(Value);
createPrinter(Builder, UseGPU, Values, args...);
createPrinter(Builder, Values, args...);
}

/// Handle StringRefs.
template <typename... Args>
static void createPrinter(PollyIRBuilder &Builder, bool UseGPU,
static void createPrinter(PollyIRBuilder &Builder,
std::vector<llvm::Value *> &Values,
llvm::StringRef String, Args... args) {
Values.push_back(getPrintableString(Builder, String));
createPrinter(Builder, UseGPU, Values, args...);
createPrinter(Builder, Values, args...);
}

/// Handle ArrayRefs.
template <typename... Args>
static void createPrinter(PollyIRBuilder &Builder, bool UseGPU,
static void createPrinter(PollyIRBuilder &Builder,
std::vector<llvm::Value *> &Values,
llvm::ArrayRef<llvm::Value *> Array, Args... args) {
Values.insert(Values.end(), Array.begin(), Array.end());
createPrinter(Builder, UseGPU, Values, args...);
createPrinter(Builder, Values, args...);
}

/// Print a list of Values.
static void createPrinter(PollyIRBuilder &Builder, bool UseGPU,
static void createPrinter(PollyIRBuilder &Builder,
llvm::ArrayRef<llvm::Value *> Values);

/// Print a list of Values on a GPU.
static void createGPUPrinterT(PollyIRBuilder &Builder,
llvm::ArrayRef<llvm::Value *> Values);

/// Print a list of Values on a CPU.
static void createCPUPrinterT(PollyIRBuilder &Builder,
llvm::ArrayRef<llvm::Value *> Values);
Expand All @@ -145,22 +120,6 @@ struct RuntimeDebugBuilder {
///
/// @parma Builder The builder used to insert the code.
static void createFlush(PollyIRBuilder &Builder);

/// Get (and possibly insert) a NVIDIA address space cast call.
static llvm::Function *getAddressSpaceCast(PollyIRBuilder &Builder,
unsigned Src, unsigned Dst,
unsigned SrcBits = 8,
unsigned DstBits = 8);

/// Get identifiers that describe the currently executed GPU thread.
///
/// The result will be a vector that if passed to the GPU printer will result
/// into a string (initialized to values corresponding to the printing
/// thread):
///
/// "> block-id: bidx bid1y bidz | thread-id: tidx tidy tidz "
static std::vector<llvm::Value *>
getGPUThreadIdentifiers(PollyIRBuilder &Builder);
};
} // namespace polly

Expand Down
3 changes: 0 additions & 3 deletions polly/include/polly/Config/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@
#ifndef POLLY_CONFIG_H
#define POLLY_CONFIG_H

#cmakedefine CUDA_FOUND
#cmakedefine GPU_CODEGEN

#endif
17 changes: 0 additions & 17 deletions polly/include/polly/LinkAllPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#ifndef POLLY_LINKALLPASSES_H
#define POLLY_LINKALLPASSES_H

#include "polly/CodeGen/PPCGCodeGeneration.h"
#include "polly/Config/config.h"
#include "polly/Support/DumpFunctionPass.h"
#include "polly/Support/DumpModulePass.h"
Expand Down Expand Up @@ -54,14 +53,6 @@ llvm::Pass *createScopInfoPrinterLegacyFunctionPass(llvm::raw_ostream &OS);
llvm::Pass *createIslAstInfoWrapperPassPass();
llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS);
llvm::Pass *createCodeGenerationPass();
#ifdef GPU_CODEGEN
llvm::Pass *createPPCGCodeGenerationPass(GPUArch Arch = GPUArch::NVPTX64,
GPURuntime Runtime = GPURuntime::CUDA);

llvm::Pass *
createManagedMemoryRewritePassPass(GPUArch Arch = GPUArch::NVPTX64,
GPURuntime Runtime = GPURuntime::CUDA);
#endif
llvm::Pass *createIslScheduleOptimizerWrapperPass();
llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS);
llvm::Pass *createFlattenSchedulePass();
Expand Down Expand Up @@ -113,10 +104,6 @@ struct PollyForcePassLinking {
polly::createIslAstInfoWrapperPassPass();
polly::createIslAstInfoPrinterLegacyPass(llvm::outs());
polly::createCodeGenerationPass();
#ifdef GPU_CODEGEN
polly::createPPCGCodeGenerationPass();
polly::createManagedMemoryRewritePassPass();
#endif
polly::createIslScheduleOptimizerWrapperPass();
polly::createIslScheduleOptimizerPrinterLegacyPass(llvm::outs());
polly::createMaximalStaticExpansionPass();
Expand Down Expand Up @@ -156,10 +143,6 @@ void initializeDependenceInfoPrinterLegacyFunctionPassPass(
void initializeIslAstInfoWrapperPassPass(llvm::PassRegistry &);
void initializeIslAstInfoPrinterLegacyPassPass(llvm::PassRegistry &);
void initializeCodeGenerationPass(llvm::PassRegistry &);
#ifdef GPU_CODEGEN
void initializePPCGCodeGenerationPass(llvm::PassRegistry &);
void initializeManagedMemoryRewritePassPass(llvm::PassRegistry &);
#endif
void initializeIslScheduleOptimizerWrapperPassPass(llvm::PassRegistry &);
void initializeIslScheduleOptimizerPrinterLegacyPassPass(llvm::PassRegistry &);
void initializeMaximalStaticExpanderWrapperPassPass(llvm::PassRegistry &);
Expand Down
9 changes: 0 additions & 9 deletions polly/include/polly/ScopInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1684,9 +1684,6 @@ class Scop final {
/// Number of copy statements.
unsigned CopyStmtsNum = 0;

/// Flag to indicate if the Scop is to be skipped.
bool SkipScop = false;

using StmtSet = std::list<ScopStmt>;

/// The statements in this Scop.
Expand Down Expand Up @@ -2144,12 +2141,6 @@ class Scop final {
/// Check if the SCoP has been optimized by the scheduler.
bool isOptimized() const { return IsOptimized; }

/// Mark the SCoP to be skipped by ScopPass passes.
void markAsToBeSkipped() { SkipScop = true; }

/// Check if the SCoP is to be skipped by ScopPass passes.
bool isToBeSkipped() const { return SkipScop; }

/// Return the ID of the Scop
int getID() const { return ID; }

Expand Down
42 changes: 0 additions & 42 deletions polly/include/polly/Support/LinkGPURuntime.h

This file was deleted.

Loading

0 comments on commit 19afbfe

Please sign in to comment.