Author: Arthur Eubanks Date: 2026-04-15T22:58:20Z New Revision: 561cf0c4f5f7c48b434c6c363c233a1b97b0ee63
URL: https://github.com/llvm/llvm-project/commit/561cf0c4f5f7c48b434c6c363c233a1b97b0ee63 DIFF: https://github.com/llvm/llvm-project/commit/561cf0c4f5f7c48b434c6c363c233a1b97b0ee63.diff LOG: [NFC] Move TimePasses globals from Pass.h to PassTimingInfo.h (#192352) They don't belong in the legacy pass manager-specific header, they apply to both pass managers, plus the pass manager isn't the right layer to put the bools anyway. Added: Modified: clang/lib/CodeGen/CodeGenAction.cpp flang/lib/Frontend/CompilerInstance.cpp llvm/include/llvm/IR/PassTimingInfo.h llvm/include/llvm/Pass.h llvm/lib/CodeGen/RegAllocBase.cpp llvm/lib/CodeGen/RegAllocGreedy.cpp llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/lib/IRReader/IRReader.cpp llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp llvm/unittests/IR/TimePassesTest.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index 8a82cd057376d..73bf49b1a8046 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -40,6 +40,7 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/IR/LLVMRemarkStreamer.h" #include "llvm/IR/Module.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/IR/Verifier.h" #include "llvm/IRReader/IRReader.h" #include "llvm/LTO/LTOBackend.h" diff --git a/flang/lib/Frontend/CompilerInstance.cpp b/flang/lib/Frontend/CompilerInstance.cpp index 66c011e8672c6..28011e8bf685a 100644 --- a/flang/lib/Frontend/CompilerInstance.cpp +++ b/flang/lib/Frontend/CompilerInstance.cpp @@ -21,6 +21,7 @@ #include "mlir/Support/RawOstreamExtras.h" #include "clang/Basic/DiagnosticFrontend.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/MC/TargetRegistry.h" #include "llvm/Pass.h" #include "llvm/Support/Errc.h" diff --git a/llvm/include/llvm/IR/PassTimingInfo.h b/llvm/include/llvm/IR/PassTimingInfo.h index 03e481a50342b..cf2dcd33fdb96 100644 --- a/llvm/include/llvm/IR/PassTimingInfo.h +++ b/llvm/include/llvm/IR/PassTimingInfo.h @@ -29,6 +29,17 @@ class Pass; class PassInstrumentationCallbacks; class raw_ostream; +/// If the user specifies the -time-passes argument on an LLVM tool command line +/// then the value of this boolean will be true, otherwise false. +/// This is the storage for the -time-passes option. +LLVM_ABI extern bool TimePassesIsEnabled; +/// If TimePassesPerRun is true, there would be one line of report for +/// each pass invocation. +/// If TimePassesPerRun is false, there would be only one line of +/// report for each pass (even there are more than one pass objects). +/// (For new pass manager only) +LLVM_ABI extern bool TimePassesPerRun; + /// If -time-passes has been specified, report the timings immediately and then /// reset the timers to zero. By default it uses the stream created by /// CreateInfoOutputFile(). diff --git a/llvm/include/llvm/Pass.h b/llvm/include/llvm/Pass.h index f3962c3556c95..d4991b6a2212c 100644 --- a/llvm/include/llvm/Pass.h +++ b/llvm/include/llvm/Pass.h @@ -335,17 +335,6 @@ class LLVM_ABI FunctionPass : public Pass { bool skipFunction(const Function &F) const; }; -/// If the user specifies the -time-passes argument on an LLVM tool command line -/// then the value of this boolean will be true, otherwise false. -/// This is the storage for the -time-passes option. -LLVM_ABI extern bool TimePassesIsEnabled; -/// If TimePassesPerRun is true, there would be one line of report for -/// each pass invocation. -/// If TimePassesPerRun is false, there would be only one line of -/// report for each pass (even there are more than one pass objects). -/// (For new pass manager only) -LLVM_ABI extern bool TimePassesPerRun; - } // end namespace llvm // Include support files that contain important APIs commonly used by Passes, diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp index 9ba6007fc1cb9..471237730ec7a 100644 --- a/llvm/lib/CodeGen/RegAllocBase.cpp +++ b/llvm/lib/CodeGen/RegAllocBase.cpp @@ -25,6 +25,7 @@ #include "llvm/CodeGen/VirtRegMap.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/Module.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index 8565a7233d32c..dd86fa127e6dc 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -61,6 +61,7 @@ #include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/Function.h" #include "llvm/IR/LLVMContext.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/Pass.h" #include "llvm/Support/BlockFrequency.h" #include "llvm/Support/BranchProbability.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 02c2444fc9d9e..7aec7f41c15f2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -80,6 +80,7 @@ #include "llvm/IR/IntrinsicsWebAssembly.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Module.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/IR/PrintPasses.h" #include "llvm/IR/Statepoint.h" #include "llvm/IR/Type.h" diff --git a/llvm/lib/IRReader/IRReader.cpp b/llvm/lib/IRReader/IRReader.cpp index 29bf18c01fd7c..8b3978c728a6e 100644 --- a/llvm/lib/IRReader/IRReader.cpp +++ b/llvm/lib/IRReader/IRReader.cpp @@ -13,6 +13,7 @@ #include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/Timer.h" @@ -23,10 +24,6 @@ using namespace llvm; -namespace llvm { - extern bool TimePassesIsEnabled; -} - const char TimeIRParsingGroupName[] = "irparse"; const char TimeIRParsingGroupDescription[] = "LLVM IR Parsing"; const char TimeIRParsingName[] = "parse"; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp index 4a63d5ba01ca9..891d529e2c998 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUSplitModule.cpp @@ -47,6 +47,7 @@ #include "llvm/IR/InstIterator.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/Module.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/IR/Value.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Casting.h" diff --git a/llvm/unittests/IR/TimePassesTest.cpp b/llvm/unittests/IR/TimePassesTest.cpp index 85986132103ca..c6a74c6686214 100644 --- a/llvm/unittests/IR/TimePassesTest.cpp +++ b/llvm/unittests/IR/TimePassesTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/IR/LegacyPassManager.h" +#include "llvm/IR/PassTimingInfo.h" #include "llvm/Pass.h" #include "llvm/PassRegistry.h" #include <gtest/gtest.h> _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
