[PATCH] D90486: [NewPM] Add OptimizationLevel param to TargetMachine::registerPassBuilderCallbacks()
Arthur Eubanks via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 30 10:57:13 PDT 2020
aeubanks created this revision.
Herald added subscribers: llvm-commits, cfe-commits, steven_wu, hiraditya, tpr, mgorny.
Herald added a reviewer: bollu.
Herald added projects: clang, LLVM.
aeubanks requested review of this revision.
To prevent targets from adding optional passes for -O0,
TargetMachine::registerPassBuilderCallbacks() needs an OptimizationLevel
parameter to see if it's O0.
Currently no existing users require this, but some targets that haven't
implemented TargetMachine::registerPassBuilderCallbacks() yet will
require it, e.g. AMDGPU.
This requires moving OptimizationLevel out of PassBuilder, or else
TargetMachine.h will have to #include all of PassBuilder.h.
Since registerPassBuilderCallbacks() now requires an OptimizationLevel,
we can't call it in PassBuilder's constructor. Rather, it's called when
we create a full pipeline, whether default or LTO or O0. This makes
sense since there's no need to run registerPassBuilderCallbacks() when
adding individual passes via PassBuilder, only when creating full
pipelines.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D90486
Files:
clang/lib/CodeGen/BackendUtil.cpp
llvm/examples/Bye/Bye.cpp
llvm/include/llvm/Passes/OptimizationLevel.h
llvm/include/llvm/Passes/PassBuilder.h
llvm/include/llvm/Target/TargetMachine.h
llvm/lib/LTO/LTOBackend.cpp
llvm/lib/Passes/CMakeLists.txt
llvm/lib/Passes/OptimizationLevel.cpp
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Target/BPF/BPFTargetMachine.cpp
llvm/lib/Target/BPF/BPFTargetMachine.h
llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
llvm/lib/Target/Hexagon/HexagonTargetMachine.h
llvm/tools/opt/NewPMDriver.cpp
llvm/utils/gn/secondary/llvm/lib/Passes/BUILD.gn
polly/lib/Support/RegisterPasses.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90486.301963.patch
Type: text/x-patch
Size: 33373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201030/4ebf3ee6/attachment-0001.bin>
More information about the cfe-commits
mailing list