Skip to content

Commit a0fcd3a

Browse files
author
Valery N Dmitriev
committed
Merge from 'master' to 'sycl-web' (#2)
CONFLICT (content): Merge conflict in clang/lib/CodeGen/BackendUtil.cpp
2 parents 5c3c697 + 1fbb719 commit a0fcd3a

File tree

20 files changed

+162
-314
lines changed

20 files changed

+162
-314
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ CODEGENOPT(UnwindTables , 1, 0) ///< Emit unwind tables.
254254
CODEGENOPT(VectorizeLoop , 1, 0) ///< Run loop vectorizer.
255255
CODEGENOPT(VectorizeSLP , 1, 0) ///< Run SLP vectorizer.
256256
CODEGENOPT(ProfileSampleAccurate, 1, 0) ///< Sample profile is accurate.
257-
CODEGENOPT(CallGraphProfile , 1, 0) ///< Run call graph profile.
258257

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

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,9 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
657657
PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize;
658658
PMBuilder.SLPVectorize = CodeGenOpts.VectorizeSLP;
659659
PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop;
660+
// Only enable CGProfilePass when using integrated assembler, since
661+
// non-integrated assemblers don't recognize .cgprofile section.
662+
PMBuilder.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
660663

661664
PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops;
662665
// Loop interleaving in the loop vectorizer has historically been set to be
@@ -1186,7 +1189,9 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
11861189
PTO.LoopInterleaving = CodeGenOpts.UnrollLoops;
11871190
PTO.LoopVectorization = CodeGenOpts.VectorizeLoop;
11881191
PTO.SLPVectorization = CodeGenOpts.VectorizeSLP;
1189-
PTO.CallGraphProfile = CodeGenOpts.CallGraphProfile;
1192+
// Only enable CGProfilePass when using integrated assembler, since
1193+
// non-integrated assemblers don't recognize .cgprofile section.
1194+
PTO.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
11901195
PTO.Coroutines = LangOpts.Coroutines;
11911196

11921197
PassInstrumentationCallbacks PIC;
@@ -1604,7 +1609,9 @@ static void runThinLTOBackend(
16041609
Conf.PTO.LoopInterleaving = CGOpts.UnrollLoops;
16051610
Conf.PTO.LoopVectorization = CGOpts.VectorizeLoop;
16061611
Conf.PTO.SLPVectorization = CGOpts.VectorizeSLP;
1607-
Conf.PTO.CallGraphProfile = CGOpts.CallGraphProfile;
1612+
// Only enable CGProfilePass when using integrated assembler, since
1613+
// non-integrated assemblers don't recognize .cgprofile section.
1614+
Conf.PTO.CallGraphProfile = !CGOpts.DisableIntegratedAS;
16081615

16091616
// Context sensitive profile.
16101617
if (CGOpts.hasProfileCSIRInstr()) {

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@ 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;
868867
Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
869868
Opts.SampleProfileFile =
870869
std::string(Args.getLastArgValue(OPT_fprofile_sample_use_EQ));

llvm/include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ void initializeCFGViewerLegacyPassPass(PassRegistry&);
103103
void initializeCFIInstrInserterPass(PassRegistry&);
104104
void initializeCFLAndersAAWrapperPassPass(PassRegistry&);
105105
void initializeCFLSteensAAWrapperPassPass(PassRegistry&);
106+
void initializeCGProfileLegacyPassPass(PassRegistry &);
106107
void initializeCallGraphDOTPrinterPass(PassRegistry&);
107108
void initializeCallGraphPrinterLegacyPassPass(PassRegistry&);
108109
void initializeCallGraphViewerPass(PassRegistry&);

llvm/include/llvm/Transforms/IPO.h

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

285+
ModulePass *createCGProfileLegacyPass();
286+
285287
} // End llvm namespace
286288

287289
#endif

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,14 +1036,6 @@ struct Attributor {
10361036
identifyDefaultAbstractAttributes(const_cast<Function &>(F));
10371037
}
10381038

1039-
/// Helper function to remove callsite.
1040-
void removeCallSite(CallInst *CI) {
1041-
if (!CI)
1042-
return;
1043-
1044-
CGUpdater.removeCallSite(*CI);
1045-
}
1046-
10471039
/// Record that \p U is to be replaces with \p NV after information was
10481040
/// manifested. This also triggers deletion of trivially dead istructions.
10491041
bool changeUseAfterManifest(Use &U, Value &NV) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class PassManagerBuilder {
156156

157157
bool DisableTailCalls;
158158
bool DisableUnrollLoops;
159+
bool CallGraphProfile;
159160
bool SLPVectorize;
160161
bool LoopVectorize;
161162
bool LoopsInterleaved;

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ 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;
2722
};
2823
} // end namespace llvm
2924

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ 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-
255251
/// Flag to enable inline deferral during PGO.
256252
static cl::opt<bool>
257253
EnablePGOInlineDeferral("enable-npm-pgo-inline-deferral", cl::init(true),
@@ -267,7 +263,7 @@ PipelineTuningOptions::PipelineTuningOptions() {
267263
Coroutines = false;
268264
LicmMssaOptCap = SetLicmMssaOptCap;
269265
LicmMssaNoAccForPromotionCap = SetLicmMssaNoAccForPromotionCap;
270-
CallGraphProfile = EnableCallGraphProfile;
266+
CallGraphProfile = true;
271267
}
272268

273269
extern cl::opt<bool> EnableHotColdSplit;

0 commit comments

Comments
 (0)