cpu_compiler.cc
imports tsl/platform/casts.himports tsl/platform/cpu_info.h
SHA-256684b5c15f21a8260ad2166e5b100ca01b44410e354e9fbc977292e6ebe4b5368
MaleculeMd(In₈)
Evidence
1/* Copyright 2017 The OpenXLA Authors.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "xla/service/cpu/cpu_compiler.h"
17
18#include <algorithm>
19#include <cstddef>
20#include <cstdint>
21#include <cstring>
22#include <functional>
23#include <limits>
24#include <memory>
25#include <optional>
26#include <stack>
27#include <string>
28#include <tuple>
29#include <utility>
30#include <vector>
31
32#include "absl/algorithm/container.h"
33
34// IWYU pragma: no_include "llvm/Config/Disassemblers.def.inc"
35// IWYU pragma: no_include "llvm/Config/Targets.def.inc"
36
37#include "absl/container/flat_hash_map.h"
38#include "absl/container/flat_hash_set.h"
39#include "absl/log/check.h"
40#include "absl/log/log.h"
41#include "absl/memory/memory.h"
42#include "absl/status/status.h"
43#include "absl/status/statusor.h"
44#include "absl/strings/match.h"
45#include "absl/strings/str_cat.h"
46#include "absl/strings/str_format.h"
47#include "absl/strings/str_join.h"
48#include "absl/strings/string_view.h"
49#include "absl/types/span.h"
50#include "llvm/ADT/SmallVector.h"
51#include "llvm/ADT/StringRef.h"
52#include "llvm/Bitcode/BitcodeReader.h"
53#include "llvm/Bitcode/BitcodeWriter.h"
54#include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
55#include "llvm/IR/DerivedTypes.h"
56#include "llvm/IR/Function.h"
57#include "llvm/IR/GlobalVariable.h"
58#include "llvm/IR/LLVMContext.h"
277 return thread_pool;
278}
279
280// Returns task runner that uses the global compilation thread pool.
281static cpu::JitCompiler::TaskRunner GetCompilationTask …
365:7… s visitor records which HLO instructions should have profiling information
366// recorded.
367class CollectProfileCandidates : public DfsHloVisitorWithDef …