Skip to content

Commit 978a2e4

Browse files
author
Valery N Dmitriev
committed
Merge from 'master' to 'sycl-web' (#8)
CONFLICT (content): Merge conflict in clang/lib/CodeGen/BackendUtil.cpp
2 parents 8978764 + c025bdf commit 978a2e4

36 files changed

+569
-156
lines changed

clang/cmake/caches/Fuchsia-stage2.cmake

+34-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
55
set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
66

77
set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld;llvm" CACHE STRING "")
8-
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
98

109
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
1110
if(NOT APPLE)
@@ -22,6 +21,10 @@ set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
2221
set(LLVM_USE_RELATIVE_PATHS_IN_FILES ON CACHE BOOL "")
2322
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
2423

24+
if(MSVC)
25+
set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
26+
endif()
27+
2528
set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
2629
if(NOT APPLE)
2730
set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
@@ -39,6 +42,8 @@ set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
3942
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
4043
if (APPLE)
4144
set(MACOSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "")
45+
elseif(MSVC)
46+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
4247
endif()
4348

4449
if(APPLE)
@@ -65,6 +70,26 @@ if(APPLE)
6570
set(DARWIN_iossim_ARCHS i386;x86_64 CACHE STRING "")
6671
set(DARWIN_osx_ARCHS x86_64 CACHE STRING "")
6772
set(SANITIZER_MIN_OSX_VERSION 10.7 CACHE STRING "")
73+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
74+
endif()
75+
76+
if(WIN32)
77+
set(target "x86_64-pc-windows-msvc")
78+
79+
list(APPEND BUILTIN_TARGETS "${target}")
80+
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
81+
set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
82+
83+
list(APPEND RUNTIME_TARGETS "${target}")
84+
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Windows CACHE STRING "")
85+
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
86+
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
87+
set(RUNTIMES_${target}_LIBCXX_HAS_WIN32_THREAD_API ON CACHE BOOL "")
88+
set(RUNTIMES_${target}_LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
89+
set(RUNTIMES_${target}_LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
90+
set(RUNTIMES_${target}_LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
91+
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
92+
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
6893
endif()
6994

7095
foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unknown-linux-gnu;x86_64-unknown-linux-gnu)
@@ -73,6 +98,9 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
7398
list(APPEND BUILTIN_TARGETS "${target}")
7499
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
75100
set(BUILTINS_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
101+
set(BUILTINS_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
102+
set(BUILTINS_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
103+
set(BUILTINS_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
76104
set(BUILTINS_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
77105
set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
78106
set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
@@ -82,6 +110,9 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
82110
list(APPEND RUNTIME_TARGETS "${target}")
83111
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
84112
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
113+
set(RUNTIMES_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
114+
set(RUNTIMES_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
115+
set(RUNTIMES_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
85116
set(RUNTIMES_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
86117
set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
87118
set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
@@ -100,9 +131,9 @@ foreach(target aarch64-unknown-linux-gnu;armv7-unknown-linux-gnueabihf;i386-unkn
100131
set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
101132
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
102133
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
103-
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
104134
set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
105135
set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
136+
set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
106137

107138
# Use .build-id link.
108139
list(APPEND RUNTIME_BUILD_ID_LINK "${target}")
@@ -115,7 +146,7 @@ if(FUCHSIA_SDK)
115146
set(FUCHSIA_x86_64_NAME x64)
116147
set(FUCHSIA_riscv64_NAME riscv64)
117148
foreach(target i386;x86_64;aarch64;riscv64)
118-
set(FUCHSIA_${target}_COMPILER_FLAGS "-I${FUCHSIA_SDK}/pkg/fdio/include")
149+
set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target}-unknown-fuchsia -I${FUCHSIA_SDK}/pkg/fdio/include")
119150
set(FUCHSIA_${target}_LINKER_FLAGS "-L${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/lib")
120151
set(FUCHSIA_${target}_SYSROOT "${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/sysroot")
121152
endforeach()

clang/cmake/caches/Fuchsia.cmake

+20-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
55
set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
66

77
set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld;llvm" CACHE STRING "")
8-
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
98

109
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
1110
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
@@ -16,6 +15,10 @@ set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
1615
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
1716
set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
1817

18+
if(MSVC)
19+
set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
20+
endif()
21+
1922
set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
2023
if(NOT APPLE)
2124
set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
@@ -32,8 +35,10 @@ set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
3235

3336
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
3437
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
35-
if (APPLE)
38+
if(APPLE)
3639
set(MACOSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "")
40+
elseif(MSVC)
41+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "")
3742
endif()
3843

3944
if(APPLE)
@@ -52,8 +57,19 @@ set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
5257
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
5358
set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
5459
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
55-
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
56-
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
60+
if(WIN32)
61+
set(LIBCXX_HAS_WIN32_THREAD_API ON CACHE BOOL "")
62+
set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
63+
set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
64+
set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
65+
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY OFF CACHE BOOL "")
66+
set(BUILTINS_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
67+
set(RUNTIMES_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "")
68+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "")
69+
else()
70+
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
71+
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
72+
endif()
5773

5874
if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
5975
set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}")

clang/include/clang/Basic/CodeGenOptions.def

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ CODEGENOPT(UnwindTables , 1, 0) ///< Emit unwind tables.
252252
CODEGENOPT(VectorizeLoop , 1, 0) ///< Run loop vectorizer.
253253
CODEGENOPT(VectorizeSLP , 1, 0) ///< Run SLP vectorizer.
254254
CODEGENOPT(ProfileSampleAccurate, 1, 0) ///< Sample profile is accurate.
255+
CODEGENOPT(CallGraphProfile , 1, 0) ///< Run call graph profile.
255256

256257
/// Attempt to use register sized accesses to bit-fields in structures, when
257258
/// possible.

clang/lib/CodeGen/BackendUtil.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
657657
PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize;
658658
PMBuilder.SLPVectorize = CodeGenOpts.VectorizeSLP;
659659
PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop;
660-
PMBuilder.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
661660

662661
PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops;
663662
// Loop interleaving in the loop vectorizer has historically been set to be
@@ -1187,7 +1186,7 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
11871186
PTO.LoopInterleaving = CodeGenOpts.UnrollLoops;
11881187
PTO.LoopVectorization = CodeGenOpts.VectorizeLoop;
11891188
PTO.SLPVectorization = CodeGenOpts.VectorizeSLP;
1190-
PTO.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
1189+
PTO.CallGraphProfile = CodeGenOpts.CallGraphProfile;
11911190
PTO.Coroutines = LangOpts.Coroutines;
11921191

11931192
PassInstrumentationCallbacks PIC;
@@ -1605,7 +1604,7 @@ static void runThinLTOBackend(
16051604
Conf.PTO.LoopInterleaving = CGOpts.UnrollLoops;
16061605
Conf.PTO.LoopVectorization = CGOpts.VectorizeLoop;
16071606
Conf.PTO.SLPVectorization = CGOpts.VectorizeSLP;
1608-
Conf.PTO.CallGraphProfile = !CGOpts.DisableIntegratedAS;
1607+
Conf.PTO.CallGraphProfile = CGOpts.CallGraphProfile;
16091608

16101609
// Context sensitive profile.
16111610
if (CGOpts.hasProfileCSIRInstr()) {

clang/lib/Frontend/CompilerInvocation.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
864864
Opts.RerollLoops = Args.hasArg(OPT_freroll_loops);
865865

866866
Opts.DisableIntegratedAS = Args.hasArg(OPT_fno_integrated_as);
867+
Opts.CallGraphProfile = !Opts.DisableIntegratedAS;
867868
Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
868869
Opts.SampleProfileFile =
869870
std::string(Args.getLastArgValue(OPT_fprofile_sample_use_EQ));

llvm/docs/CodingStandards.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,9 @@ loops wherever possible for all newly added code. For example:
13021302
for (Instruction &I : *BB)
13031303
... use I ...
13041304
1305+
Usage of ``std::for_each()``/``llvm::for_each()`` functions is discouraged,
1306+
unless the the callable object already exists.
1307+
13051308
Don't evaluate ``end()`` every time through a loop
13061309
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13071310

llvm/include/llvm/IR/Function.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,11 @@ class Function : public GlobalObject, public ilist_node<Function> {
830830

831831
/// hasAddressTaken - returns true if there are any uses of this function
832832
/// other than direct calls or invokes to it, or blockaddress expressions.
833-
/// Optionally passes back an offending user for diagnostic purposes.
833+
/// Optionally passes back an offending user for diagnostic purposes and
834+
/// ignores callback uses.
834835
///
835-
bool hasAddressTaken(const User** = nullptr) const;
836+
bool hasAddressTaken(const User ** = nullptr,
837+
bool IgnoreCallbackUses = false) const;
836838

837839
/// isDefTriviallyDead - Return true if it is trivially safe to remove
838840
/// this function definition from the module (because it isn't externally

llvm/include/llvm/InitializePasses.h

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ void initializeCFGViewerLegacyPassPass(PassRegistry&);
103103
void initializeCFIInstrInserterPass(PassRegistry&);
104104
void initializeCFLAndersAAWrapperPassPass(PassRegistry&);
105105
void initializeCFLSteensAAWrapperPassPass(PassRegistry&);
106-
void initializeCGProfileLegacyPassPass(PassRegistry &);
107106
void initializeCallGraphDOTPrinterPass(PassRegistry&);
108107
void initializeCallGraphPrinterLegacyPassPass(PassRegistry&);
109108
void initializeCallGraphViewerPass(PassRegistry&);

llvm/include/llvm/Transforms/IPO.h

-2
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ ModulePass *createSampleProfileLoaderPass(StringRef Name);
282282
ModulePass *createWriteThinLTOBitcodePass(raw_ostream &Str,
283283
raw_ostream *ThinLinkOS = nullptr);
284284

285-
ModulePass *createCGProfileLegacyPass();
286-
287285
} // End llvm namespace
288286

289287
#endif

llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ class PassManagerBuilder {
156156

157157
bool DisableTailCalls;
158158
bool DisableUnrollLoops;
159-
bool CallGraphProfile;
160159
bool SLPVectorize;
161160
bool LoopVectorize;
162161
bool LoopsInterleaved;

llvm/include/llvm/Transforms/Instrumentation/CGProfile.h

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ namespace llvm {
1919
class CGProfilePass : public PassInfoMixin<CGProfilePass> {
2020
public:
2121
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
22+
23+
private:
24+
void addModuleFlags(
25+
Module &M,
26+
MapVector<std::pair<Function *, Function *>, uint64_t> &Counts) const;
2227
};
2328
} // end namespace llvm
2429

llvm/lib/Analysis/CallGraph.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ bool CallGraph::invalidate(Module &, const PreservedAnalyses &PA,
7777
void CallGraph::addToCallGraph(Function *F) {
7878
CallGraphNode *Node = getOrInsertFunction(F);
7979

80-
// If this function has external linkage or has its address taken, anything
81-
// could call it.
82-
if (!F->hasLocalLinkage() || F->hasAddressTaken())
80+
bool IgnoreCallbackUses = true;
81+
82+
// If this function has external linkage or has its address taken and
83+
// it is not a callback, then anything could call it.
84+
if (!F->hasLocalLinkage() || F->hasAddressTaken(nullptr, IgnoreCallbackUses))
8385
ExternalCallingNode->addCalledFunction(nullptr, Node);
8486

8587
populateCallGraphNode(Node);

llvm/lib/IR/Function.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "llvm/ADT/SmallVector.h"
2121
#include "llvm/ADT/StringExtras.h"
2222
#include "llvm/ADT/StringRef.h"
23+
#include "llvm/IR/AbstractCallSite.h"
2324
#include "llvm/IR/Argument.h"
2425
#include "llvm/IR/Attributes.h"
2526
#include "llvm/IR/BasicBlock.h"
@@ -1484,12 +1485,18 @@ Optional<Function *> Intrinsic::remangleIntrinsicFunction(Function *F) {
14841485
}
14851486

14861487
/// hasAddressTaken - returns true if there are any uses of this function
1487-
/// other than direct calls or invokes to it.
1488-
bool Function::hasAddressTaken(const User* *PutOffender) const {
1488+
/// other than direct calls or invokes to it. Optionally ignores callback
1489+
/// uses.
1490+
bool Function::hasAddressTaken(const User **PutOffender,
1491+
bool IgnoreCallbackUses) const {
14891492
for (const Use &U : uses()) {
14901493
const User *FU = U.getUser();
14911494
if (isa<BlockAddress>(FU))
14921495
continue;
1496+
1497+
if (IgnoreCallbackUses && AbstractCallSite(&U))
1498+
continue;
1499+
14931500
const auto *Call = dyn_cast<CallBase>(FU);
14941501
if (!Call) {
14951502
if (PutOffender)

llvm/lib/Passes/PassBuilder.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ static cl::opt<bool>
248248
EnableCHR("enable-chr-npm", cl::init(true), cl::Hidden,
249249
cl::desc("Enable control height reduction optimization (CHR)"));
250250

251+
static cl::opt<bool> EnableCallGraphProfile(
252+
"enable-npm-call-graph-profile", cl::init(true), cl::Hidden,
253+
cl::desc("Enable call graph profile pass for the new PM (default = on)"));
254+
251255
/// Flag to enable inline deferral during PGO.
252256
static cl::opt<bool>
253257
EnablePGOInlineDeferral("enable-npm-pgo-inline-deferral", cl::init(true),
@@ -263,7 +267,7 @@ PipelineTuningOptions::PipelineTuningOptions() {
263267
Coroutines = false;
264268
LicmMssaOptCap = SetLicmMssaOptCap;
265269
LicmMssaNoAccForPromotionCap = SetLicmMssaNoAccForPromotionCap;
266-
CallGraphProfile = true;
270+
CallGraphProfile = EnableCallGraphProfile;
267271
}
268272

269273
extern cl::opt<bool> EnableHotColdSplit;

llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ PassManagerBuilder::PassManagerBuilder() {
195195
PrepareForThinLTO = EnablePrepareForThinLTO;
196196
PerformThinLTO = EnablePerformThinLTO;
197197
DivergentTarget = false;
198-
CallGraphProfile = true;
199198
}
200199

201200
PassManagerBuilder::~PassManagerBuilder() {
@@ -835,10 +834,6 @@ void PassManagerBuilder::populateModulePassManager(
835834
if (MergeFunctions)
836835
MPM.add(createMergeFunctionsPass());
837836

838-
// Add Module flag "CG Profile" based on Branch Frequency Information.
839-
if (CallGraphProfile)
840-
MPM.add(createCGProfileLegacyPass());
841-
842837
// LoopSink pass sinks instructions hoisted by LICM, which serves as a
843838
// canonicalization pass that enables other optimizations. As a result,
844839
// LoopSink pass needs to be a very late IR pass to avoid undoing LICM

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,8 @@ STATISTIC(NumReassoc , "Number of reassociations");
123123
DEBUG_COUNTER(VisitCounter, "instcombine-visit",
124124
"Controls which instructions are visited");
125125

126-
// FIXME: these limits eventually should be as low as 2.
127126
static constexpr unsigned InstCombineDefaultMaxIterations = 1000;
128-
#ifndef NDEBUG
129-
static constexpr unsigned InstCombineDefaultInfiniteLoopThreshold = 100;
130-
#else
131127
static constexpr unsigned InstCombineDefaultInfiniteLoopThreshold = 1000;
132-
#endif
133128

134129
static cl::opt<bool>
135130
EnableCodeSinking("instcombine-code-sinking", cl::desc("Enable code sinking"),

0 commit comments

Comments
 (0)