Skip to content

Commit

Permalink
Revert "[CMake][NewPM] Move ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER into…
Browse files Browse the repository at this point in the history
… llvm/"

The new pass manager was accidentally enabled by default with this change.

This reverts commit a36bd4c.
  • Loading branch information
aeubanks committed Dec 1, 2020
1 parent f9eaa46 commit 806a76c
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 18 deletions.
3 changes: 3 additions & 0 deletions clang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL
"enable x86 relax relocations by default")

set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL
"Enable the experimental new pass manager by default.")

set(CLANG_SPAWN_CC1 OFF CACHE BOOL
"Whether clang should use a new process for the CC1 invocation")

Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Config/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
/* enable x86 relax relocations by default */
#cmakedefine01 ENABLE_X86_RELAX_RELOCATIONS

/* Enable the experimental new pass manager by default */
#cmakedefine01 ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER

/* Enable each functionality of modules */
#cmakedefine01 CLANG_ENABLE_ARCMT
#cmakedefine01 CLANG_ENABLE_OBJC_REWRITER
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ def fglobal_isel : Flag<["-"], "fglobal-isel">, Group<f_clang_Group>,
def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>,
Alias<fglobal_isel>;
defm experimental_new_pass_manager : BooleanMarshalledFFlag<"experimental-new-pass-manager", "CodeGenOpts.ExperimentalNewPassManager",
"static_cast<unsigned>(LLVM_ENABLE_NEW_PASS_MANAGER)", "Enables an experimental new pass manager in LLVM.",
"static_cast<unsigned>(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER)", "Enables an experimental new pass manager in LLVM.",
"Disables an experimental new pass manager in LLVM.">, Group<f_clang_Group>, Flags<[CC1Option]>;
def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">,
Group<f_clang_Group>, Flags<[CC1Option]>,
Expand Down
3 changes: 1 addition & 2 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
Expand Down Expand Up @@ -598,7 +597,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
// Need this flag to turn on new pass manager via Gold plugin.
if (Args.hasFlag(options::OPT_fexperimental_new_pass_manager,
options::OPT_fno_experimental_new_pass_manager,
/* Default */ LLVM_ENABLE_NEW_PASS_MANAGER)) {
/* Default */ ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER)) {
CmdArgs.push_back("-plugin-opt=new-pass-manager");
}

Expand Down
1 change: 0 additions & 1 deletion clang/lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/Linker/Linker.h"
#include "llvm/MC/MCTargetOptions.h"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ llvm_canonicalize_cmake_booleans(
CLANG_ENABLE_STATIC_ANALYZER
CLANG_SPAWN_CC1
ENABLE_BACKTRACES
LLVM_ENABLE_NEW_PASS_MANAGER
ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
LLVM_ENABLE_ZLIB
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
LLVM_ENABLE_PLUGINS
Expand Down
2 changes: 1 addition & 1 deletion clang/test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ config.clang_staticanalyzer_z3 = "@LLVM_WITH_Z3@"
config.clang_examples = @CLANG_BUILD_EXAMPLES@
config.enable_shared = @ENABLE_SHARED@
config.enable_backtrace = @ENABLE_BACKTRACES@
config.enable_experimental_new_pass_manager = @LLVM_ENABLE_NEW_PASS_MANAGER@
config.enable_experimental_new_pass_manager = @ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER@
config.enable_threads = @LLVM_ENABLE_THREADS@
config.host_arch = "@HOST_ARCH@"
config.python_executable = "@Python3_EXECUTABLE@"
Expand Down
7 changes: 0 additions & 7 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,6 @@ else()
endif()
option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default})

set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL
"Enable the experimental new pass manager by default.")

include(HandleLLVMOptions)

find_package(Python3 COMPONENTS Interpreter)
Expand Down Expand Up @@ -812,10 +809,6 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
endif()

# Keep the legacy CMake flag ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER for
# compatibility.
set(LLVM_ENABLE_NEW_PASS_MANAGER ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER)

# Configure the three LLVM configuration header files.
configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/config.h.cmake
Expand Down
3 changes: 0 additions & 3 deletions llvm/include/llvm/Config/llvm-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,4 @@
/* Define to 1 if you have the <sysexits.h> header file. */
#cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H}

/* Define to 1 to enable the experimental new pass manager by default */
#cmakedefine01 LLVM_ENABLE_NEW_PASS_MANAGER

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ write_cmake_config("Config") {
"BACKEND_PACKAGE_STRING=LLVM ${llvm_version}git",
"ENABLE_LINKER_BUILD_ID=",
"ENABLE_X86_RELAX_RELOCATIONS=1",
"ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=",
"CLANG_ENABLE_OBJC_REWRITER=1", # FIXME: flag?
"CLANG_SYSTEMZ_DEFAULT_ARCH=z10",
]
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/gn/secondary/clang/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ write_lit_config("lit_site_cfg") {
# builds exist, to make sure it's a toolchain var.
"CMAKE_CXX_COMPILER=c++",
"ENABLE_BACKTRACES=1",
"LLVM_ENABLE_NEW_PASS_MANAGER=0",
"ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=0",
"LLVM_HOST_TRIPLE=$llvm_current_triple",
"LLVM_LIT_TOOLS_DIR=", # Intentionally empty, matches cmake build.
"LLVM_USE_SANITIZER=",
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ write_cmake_config("llvm-config") {
"LLVM_VERSION_PATCH=$llvm_version_patch",
"LLVM_WITH_Z3=",
"PACKAGE_VERSION=${llvm_version}git",
"LLVM_ENABLE_NEW_PASS_MANAGER=",
]

if (current_os == "win") {
Expand Down

0 comments on commit 806a76c

Please sign in to comment.