Index: bolt/include/bolt/Passes/ShrinkWrapping.h =================================================================== --- bolt/include/bolt/Passes/ShrinkWrapping.h +++ bolt/include/bolt/Passes/ShrinkWrapping.h @@ -307,12 +307,12 @@ std::vector> BestSavePos; /// Pass stats - static std::atomic_uint64_t SpillsMovedRegularMode; - static std::atomic_uint64_t SpillsMovedPushPopMode; - static std::atomic_uint64_t SpillsMovedDynamicCount; - static std::atomic_uint64_t SpillsFailedDynamicCount; - static std::atomic_uint64_t InstrDynamicCount; - static std::atomic_uint64_t StoreDynamicCount; + static std::atomic SpillsMovedRegularMode; + static std::atomic SpillsMovedPushPopMode; + static std::atomic SpillsMovedDynamicCount; + static std::atomic SpillsFailedDynamicCount; + static std::atomic InstrDynamicCount; + static std::atomic StoreDynamicCount; Optional AnnotationIndex; Index: bolt/lib/Passes/ShrinkWrapping.cpp =================================================================== --- bolt/lib/Passes/ShrinkWrapping.cpp +++ bolt/lib/Passes/ShrinkWrapping.cpp @@ -712,12 +712,12 @@ IsInitialized = true; } -std::atomic_uint64_t ShrinkWrapping::SpillsMovedRegularMode{0}; -std::atomic_uint64_t ShrinkWrapping::SpillsMovedPushPopMode{0}; -std::atomic_uint64_t ShrinkWrapping::SpillsMovedDynamicCount{0}; -std::atomic_uint64_t ShrinkWrapping::SpillsFailedDynamicCount{0}; -std::atomic_uint64_t ShrinkWrapping::InstrDynamicCount{0}; -std::atomic_uint64_t ShrinkWrapping::StoreDynamicCount{0}; +std::atomic ShrinkWrapping::SpillsMovedRegularMode{0}; +std::atomic ShrinkWrapping::SpillsMovedPushPopMode{0}; +std::atomic ShrinkWrapping::SpillsMovedDynamicCount{0}; +std::atomic ShrinkWrapping::SpillsFailedDynamicCount{0}; +std::atomic ShrinkWrapping::InstrDynamicCount{0}; +std::atomic ShrinkWrapping::StoreDynamicCount{0}; using BBIterTy = BinaryBasicBlock::iterator; Index: utils/bazel/llvm-project-overlay/bolt/BUILD.bazel =================================================================== --- /dev/null +++ utils/bazel/llvm-project-overlay/bolt/BUILD.bazel @@ -0,0 +1,282 @@ +# This file is licensed under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +package( + default_visibility = ["//visibility:public"], + licenses = ["notice"], +) + +cc_binary( + name = "llvm-bolt-heatmap", + srcs = glob([ + "tools/heatmap/*.cpp", + ]), + deps = [ + ":Profile", + ":Rewrite", + ":Utils", + "//llvm:MC", + "//llvm:Object", + "//llvm:Support", + "//llvm:AllTargetsAsmParsers", + "//llvm:AllTargetsDisassemblers", + ] +) + +cc_binary( + name = "merge-fdata", + srcs = glob([ + "tools/merge-fdata/*.cpp", + ]), + deps = [ + ":Profile", + "//llvm:Support", + ] +) + +cc_binary( + name = "llvm-bolt", + srcs = glob([ + "tools/driver/*.cpp", + ]), + includes = ["include"], + deps = [ + ":Profile", + ":Rewrite", + ":RuntimeLibs", + ":Utils", + ":TargetX86", + ":TargetAArch64", + "//llvm:AllTargetsAsmParsers", + "//llvm:AllTargetsCodeGens", + "//llvm:AllTargetsDisassemblers", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:Object", + "//llvm:Support", + ], +) + +cc_library( + name = "Rewrite", + srcs = glob([ + "lib/Rewrite/*.cpp", + ]), + hdrs = glob([ + "include/bolt/Rewrite/*.h", + ]), + includes = ["include"], + deps = [ + ":Core", + ":Passes", + ":Profile", + ":RuntimeLibs", + ":TargetX86", + ":Utils", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DWP", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + "//llvm:ir_headers", + ], +) + +cc_library( + name = "RuntimeLibs", + srcs = glob([ + "lib/RuntimeLibs/*.cpp", + ]), + hdrs = glob([ + "include/bolt/RuntimeLibs/*.h", + ]), + includes = ["include"], + deps = [ + ":Core", + ":Passes", + ":Utils", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DWP", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + ], +) + +cc_library( + name = "Profile", + srcs = glob([ + "lib/Profile/*.cpp", + ]), + hdrs = glob([ + "include/bolt/Profile/*.h", + ]), + includes = ["include"], + deps = [ + ":Core", + ":Passes", + ":Utils", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + ], +) + +cc_library( + name = "Passes", + srcs = glob([ + "lib/Passes/*.cpp", + ]), + hdrs = glob([ + "include/bolt/Passes/*.h", + ]), + includes = ["include"], + deps = [ + ":Core", + ":Utils", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + "//llvm:Target", + ], +) + +cc_library( + name = "TargetX86", + srcs = glob([ + "lib/Target/X86/*.cpp", + ]), + hdrs = glob([ + "lib/Target/X86/*.h", + ]), + includes = ["include"], + deps = [ + ":Core", + "//llvm:X86CommonTableGen", + "//llvm:X86UtilsAndDesc", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DWP", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + ], +) + +cc_library( + name = "TargetAArch64", + srcs = glob([ + "lib/Target/AArch64/*.cpp", + ]), + hdrs = glob([ + ]), + includes = ["include"], + deps = [ + ":Core", + ":Utils", + "//llvm:AArch64CommonTableGen", + "//llvm:AArch64UtilsAndDesc", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DWP", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + ], +) + +cc_library( + name = "Core", + srcs = glob([ + "lib/Core/*.cpp", + ]), + hdrs = glob([ + "include/bolt/Core/*.h", + "include/bolt/RuntimeLibs/*.h", + "include/bolt/Passes/*.h", + "include/bolt/Rewrite/*.h", + ]), + includes = ["include"], + deps = [ + ":Utils", + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + ], +) + +cc_library( + name = "Utils", + srcs = glob([ + "lib/Utils/*.cpp", + ]), + hdrs = glob([ + "include/bolt/Utils/*.h", + ]), + includes = ["include"], + deps = [ + "//llvm:Analysis", + "//llvm:BinaryFormat", + "//llvm:CodeGen", + "//llvm:DWP", + "//llvm:DebugInfoDWARF", + "//llvm:Demangle", + "//llvm:ExecutionEngine", + "//llvm:MC", + "//llvm:MCDisassembler", + "//llvm:MCParser", + "//llvm:Object", + "//llvm:Support", + ], +)