Skip to content

Commit

Permalink
Prefix old pass manager code with "legacy" prefix
Browse files Browse the repository at this point in the history
Remove "new" prefix from new pass manager code

Move transforms.* code into legacypassmanagers.*
  • Loading branch information
yashssh committed May 13, 2024
1 parent 445ebb4 commit 90b9a0c
Show file tree
Hide file tree
Showing 18 changed files with 2,095 additions and 2,101 deletions.
10 changes: 5 additions & 5 deletions docs/source/user-guide/binding/optimization-passes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ LLVM gives you the opportunity to fine-tune optimization passes.
Optimization passes are managed by a pass manager. There are 2
kinds of pass managers:

* :class:`FunctionPassManager`, for optimizations that work on
* :class:`LegacyFunctionPassManager`, for optimizations that work on
single functions.

* :class:`ModulePassManager`, for optimizations that work on
* :class:`LegacyModulePassManager`, for optimizations that work on
whole modules.

To instantiate either of these pass managers, you first need to
Expand Down Expand Up @@ -62,7 +62,7 @@ create and configure a :class:`PassManagerBuilder`.
be enabled at the same time.


.. class:: PassManager
.. class:: LegacyPassManager

The base class for pass managers. Use individual ``add_*``
methods or :meth:`PassManagerBuilder.populate` to add
Expand Down Expand Up @@ -141,7 +141,7 @@ create and configure a :class:`PassManagerBuilder`.

See `instnamer pass documentation <http://llvm.org/docs/Passes.html#instnamer-assign-names-to-anonymous-instructions>`_.

.. class:: ModulePassManager()
.. class:: LegacyModulePassManager()

Create a new pass manager to run optimization passes on a
module.
Expand All @@ -156,7 +156,7 @@ create and configure a :class:`PassManagerBuilder`.
Returns ``True`` if the optimizations made any modification
to the module. Otherwise returns ``False``.

.. class:: FunctionPassManager(module)
.. class:: LegacyFunctionPassManager(module)

Create a new pass manager to run optimization passes on a
function of the given *module*, a :class:`ModuleRef` instance.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user-guide/binding/target-information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Classes
* .. method:: add_analysis_passes(pm)

Register analysis passes for this target machine with the
:class:`PassManager` instance *pm*.
:class:`LegacyPassManager` instance *pm*.

* .. method:: emit_object(module)

Expand Down
6 changes: 3 additions & 3 deletions docs/source/user-guide/examples/npm-usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
pto = llvm.create_pipeline_options()
pto.opt_level = 2 # similarly more properties can be set
pb = llvm.create_pass_builder(tm, pto)
npm_o2 = pb.getNewModulePassManager()
npm_o2 = pb.getModulePassManager()
npm_o2.run(llmod, pb)
print(llmod)

Expand All @@ -224,7 +224,7 @@
pb = llvm.create_pass_builder(tm, pto)
fun = llmod2.get_function("n")
print(fun)
fpm = pb.getNewFunctionPassManager()
fpm = pb.getFunctionPassManager()
fpm.add_simplify_cfg_pass()
fpm.run(fun, pb)
print(fun)
Expand All @@ -238,7 +238,7 @@
pto.opt_level = 3 # similarly more properties can be set
pto.loop_unrolling = False
pb = llvm.create_pass_builder(tm, pto)
npm = pb.getNewModulePassManager()
npm = pb.getModulePassManager()
# # Inplace optimize the IR module
npm.run(llmod_unroll, pb)
print(llmod_unroll)
Expand Down
6 changes: 3 additions & 3 deletions ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ endif()

# Define our shared library
add_library(llvmlite SHARED assembly.cpp bitcode.cpp core.cpp initfini.cpp
module.cpp value.cpp executionengine.cpp transforms.cpp type.cpp
passmanagers.cpp targets.cpp dylib.cpp linker.cpp object_file.cpp
custom_passes.cpp orcjit.cpp memorymanager.cpp newpassmanagers.cpp)
module.cpp value.cpp executionengine.cpp type.cpp
legacypassmanagers.cpp targets.cpp dylib.cpp linker.cpp object_file.cpp
custom_passes.cpp orcjit.cpp memorymanager.cpp passmanagers.cpp)

# Find the libraries that correspond to the LLVM components
# that we wish to use.
Expand Down
2 changes: 1 addition & 1 deletion ffi/Makefile.freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LDFLAGS := $(LDFLAGS) $(LLVM_LDFLAGS) $(LD_FLTO_FLAGS)
LIBS = $(LLVM_LIBS)
INCLUDE = core.h
SRC = assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp \
executionengine.cpp transforms.cpp passmanagers.cpp type.cpp targets.cpp \
executionengine.cpp legacypassmanagers.cpp type.cpp targets.cpp \
dylib.cpp linker.cpp object_file.cpp orcjit.cpp custom_passes.cpp \
memorymanager.cpp
OUTPUT = libllvmlite.so
Expand Down
4 changes: 2 additions & 2 deletions ffi/Makefile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ LDFLAGS := $(LDFLAGS) $(LLVM_LDFLAGS) $(LD_FLTO_FLAGS)
LIBS = $(LLVM_LIBS)
INCLUDE = core.h
OBJ = assembly.o bitcode.o core.o initfini.o module.o value.o \
executionengine.o transforms.o passmanagers.o targets.o type.o dylib.o \
linker.o object_file.o custom_passes.o orcjit.o memorymanager.o newpassmanagers.o
executionengine.o legacypassmanagers.o targets.o type.o dylib.o \
linker.o object_file.o custom_passes.o orcjit.o memorymanager.o passmanagers.o
OUTPUT = libllvmlite.so

all: $(OUTPUT)
Expand Down
2 changes: 1 addition & 1 deletion ffi/Makefile.osx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LDFLAGS := $(LDFLAGS) $(EXPORT) $(LLVM_LDFLAGS)
LIBS = $(LLVM_LIBS)
INCLUDE = core.h
SRC = assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp \
executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp type.cpp \
executionengine.cpp legacypassmanagers.cpp targets.cpp type.cpp \
dylib.cpp linker.cpp object_file.cpp custom_passes.cpp orcjit.cpp \
memorymanager.cpp
OUTPUT = libllvmlite.dylib
Expand Down
Loading

0 comments on commit 90b9a0c

Please sign in to comment.