[llvm] [CodeGen][X86] Remove Expensive option copy and delete copy assignment (PR #85187)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 13 23:42:28 PDT 2024
https://github.com/mahesh-attarde created https://github.com/llvm/llvm-project/pull/85187
Remove Expensive option copy and delete copy assignment
>From 8e8d0c1d8967adac605f39405bc870a57b579423 Mon Sep 17 00:00:00 2001
From: mahesh-attarde <mahesh.attarde at intel.com>
Date: Wed, 13 Mar 2024 23:33:03 -0700
Subject: [PATCH] Remove Expensive option copy and delete copy assignment
---
llvm/include/llvm/CodeGen/MachinePassManager.h | 2 ++
llvm/include/llvm/Target/TargetMachine.h | 2 +-
llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp | 2 +-
llvm/lib/Target/X86/X86TargetMachine.h | 2 +-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/MachinePassManager.h b/llvm/include/llvm/CodeGen/MachinePassManager.h
index 7713c55661ccc1..9f842a3a8f1ef7 100644
--- a/llvm/include/llvm/CodeGen/MachinePassManager.h
+++ b/llvm/include/llvm/CodeGen/MachinePassManager.h
@@ -72,6 +72,8 @@ template <typename PassT> struct MachinePassModel : MachinePassConcept {
return *this;
}
+ MachinePassModel &operator=(const MachinePassModel &) = delete;
+
PreservedAnalyses run(MachineFunction &IR,
MachineFunctionAnalysisManager &AM) override {
return Pass.run(IR, AM);
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index 37df9589e30d66..ceb371bdc73480 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -455,7 +455,7 @@ class LLVMTargetMachine : public TargetMachine {
virtual Error buildCodeGenPipeline(ModulePassManager &, raw_pwrite_stream &,
raw_pwrite_stream *, CodeGenFileType,
- CGPassBuilderOption,
+ const CGPassBuilderOption &,
PassInstrumentationCallbacks *) {
return make_error<StringError>("buildCodeGenPipeline is not overridden",
inconvertibleErrorCode());
diff --git a/llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp b/llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp
index 6ef28b373cc931..453754381034e3 100644
--- a/llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp
+++ b/llvm/lib/Target/X86/X86CodeGenPassBuilder.cpp
@@ -48,7 +48,7 @@ Error X86CodeGenPassBuilder::addInstSelector(AddMachinePass &) const {
Error X86TargetMachine::buildCodeGenPipeline(
ModulePassManager &MPM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
- CodeGenFileType FileType, CGPassBuilderOption Opt,
+ CodeGenFileType FileType, const CGPassBuilderOption &Opt,
PassInstrumentationCallbacks *PIC) {
auto CGPB = X86CodeGenPassBuilder(*this, Opt, PIC);
return CGPB.buildPipeline(MPM, Out, DwoOut, FileType);
diff --git a/llvm/lib/Target/X86/X86TargetMachine.h b/llvm/lib/Target/X86/X86TargetMachine.h
index 0fd3e47aaefe7e..4e7ded16729d07 100644
--- a/llvm/lib/Target/X86/X86TargetMachine.h
+++ b/llvm/lib/Target/X86/X86TargetMachine.h
@@ -60,7 +60,7 @@ class X86TargetMachine final : public LLVMTargetMachine {
Error buildCodeGenPipeline(ModulePassManager &, raw_pwrite_stream &,
raw_pwrite_stream *, CodeGenFileType,
- CGPassBuilderOption,
+ const CGPassBuilderOption &,
PassInstrumentationCallbacks *) override;
bool isJIT() const { return IsJIT; }
More information about the llvm-commits
mailing list