Skip to content

Commit 769ec2f

Browse files
author
git apple-llvm automerger
committed
Merge commit '2538c607e903' from llvm.org/main into next
2 parents 7847f32 + e0947c8 commit 769ec2f

File tree

10 files changed

+52
-25
lines changed

10 files changed

+52
-25
lines changed

llvm/include/llvm/CodeGen/MachineInstr.h

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -612,26 +612,12 @@ class MachineInstr
612612

613613
/// Returns a range of all of the operands that correspond to a debug use of
614614
/// \p Reg.
615-
template <typename Operand, typename Instruction>
616-
static iterator_range<
617-
filter_iterator<Operand *, std::function<bool(Operand &Op)>>>
618-
getDebugOperandsForReg(Instruction *MI, Register Reg) {
619-
std::function<bool(Operand & Op)> OpUsesReg(
620-
[Reg](Operand &Op) { return Op.isReg() && Op.getReg() == Reg; });
621-
return make_filter_range(MI->debug_operands(), OpUsesReg);
622-
}
623615
iterator_range<filter_iterator<const MachineOperand *,
624616
std::function<bool(const MachineOperand &Op)>>>
625-
getDebugOperandsForReg(Register Reg) const {
626-
return MachineInstr::getDebugOperandsForReg<const MachineOperand,
627-
const MachineInstr>(this, Reg);
628-
}
617+
getDebugOperandsForReg(Register Reg) const;
629618
iterator_range<filter_iterator<MachineOperand *,
630619
std::function<bool(MachineOperand &Op)>>>
631-
getDebugOperandsForReg(Register Reg) {
632-
return MachineInstr::getDebugOperandsForReg<MachineOperand, MachineInstr>(
633-
this, Reg);
634-
}
620+
getDebugOperandsForReg(Register Reg);
635621

636622
bool isDebugOperand(const MachineOperand *Op) const {
637623
return Op >= adl_begin(debug_operands()) && Op <= adl_end(debug_operands());

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,6 @@ class TargetLoweringBase {
330330
};
331331
using ArgListTy = std::vector<ArgListEntry>;
332332

333-
virtual void markLibCallAttributes(MachineFunction *MF, unsigned CC,
334-
ArgListTy &Args) const {};
335-
336333
static ISD::NodeType getExtendForContent(BooleanContent Content) {
337334
switch (Content) {
338335
case UndefinedBooleanContent:
@@ -351,7 +348,7 @@ class TargetLoweringBase {
351348
explicit TargetLoweringBase(const TargetMachine &TM);
352349
TargetLoweringBase(const TargetLoweringBase &) = delete;
353350
TargetLoweringBase &operator=(const TargetLoweringBase &) = delete;
354-
virtual ~TargetLoweringBase() = default;
351+
virtual ~TargetLoweringBase();
355352

356353
/// Return true if the target support strict float operation
357354
bool isStrictFPEnabled() const {
@@ -3867,6 +3864,7 @@ class TargetLowering : public TargetLoweringBase {
38673864
TargetLowering &operator=(const TargetLowering &) = delete;
38683865

38693866
explicit TargetLowering(const TargetMachine &TM);
3867+
~TargetLowering() override;
38703868

38713869
bool isPositionIndependent() const;
38723870

@@ -4593,6 +4591,9 @@ class TargetLowering : public TargetLoweringBase {
45934591
llvm_unreachable("Not Implemented");
45944592
}
45954593

4594+
virtual void markLibCallAttributes(MachineFunction *MF, unsigned CC,
4595+
ArgListTy &Args) const {}
4596+
45964597
/// This structure contains the information necessary for lowering
45974598
/// pointer-authenticating indirect calls. It is equivalent to the "ptrauth"
45984599
/// operand bundle found on the call instruction, if any.

llvm/include/llvm/Target/TargetMachine.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "llvm/ADT/StringRef.h"
1717
#include "llvm/IR/DataLayout.h"
1818
#include "llvm/IR/PassManager.h"
19-
#include "llvm/MC/MCStreamer.h"
2019
#include "llvm/Support/Allocator.h"
2120
#include "llvm/Support/CodeGen.h"
2221
#include "llvm/Support/CommandLine.h"
@@ -45,6 +44,7 @@ class MCAsmInfo;
4544
class MCContext;
4645
class MCInstrInfo;
4746
class MCRegisterInfo;
47+
class MCStreamer;
4848
class MCSubtargetInfo;
4949
class MCSymbol;
5050
class raw_pwrite_stream;
@@ -493,9 +493,7 @@ class TargetMachine {
493493
virtual Expected<std::unique_ptr<MCStreamer>>
494494
createMCStreamer(raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut,
495495
CodeGenFileType FileType, MCContext &Ctx,
496-
raw_pwrite_stream *CasIDOS = nullptr) {
497-
return nullptr;
498-
}
496+
raw_pwrite_stream *CasIDOS = nullptr);
499497

500498
/// True if the target uses physical regs (as nearly all targets do). False
501499
/// for stack machines such as WebAssembly and other virtual-register

llvm/lib/CodeGen/MachineInstr.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,28 @@ bool MachineInstr::shouldUpdateAdditionalCallInfo() const {
794794
return isCandidateForAdditionalCallInfo();
795795
}
796796

797+
template <typename Operand, typename Instruction>
798+
static iterator_range<
799+
filter_iterator<Operand *, std::function<bool(Operand &Op)>>>
800+
getDebugOperandsForRegHelper(Instruction *MI, Register Reg) {
801+
std::function<bool(Operand & Op)> OpUsesReg(
802+
[Reg](Operand &Op) { return Op.isReg() && Op.getReg() == Reg; });
803+
return make_filter_range(MI->debug_operands(), OpUsesReg);
804+
}
805+
806+
iterator_range<filter_iterator<const MachineOperand *,
807+
std::function<bool(const MachineOperand &Op)>>>
808+
MachineInstr::getDebugOperandsForReg(Register Reg) const {
809+
return getDebugOperandsForRegHelper<const MachineOperand, const MachineInstr>(
810+
this, Reg);
811+
}
812+
813+
iterator_range<
814+
filter_iterator<MachineOperand *, std::function<bool(MachineOperand &Op)>>>
815+
MachineInstr::getDebugOperandsForReg(Register Reg) {
816+
return getDebugOperandsForRegHelper<MachineOperand, MachineInstr>(this, Reg);
817+
}
818+
797819
unsigned MachineInstr::getNumExplicitOperands() const {
798820
unsigned NumOperands = MCID->getNumOperands();
799821
if (!MCID->isVariadic())

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ using namespace llvm;
4141
TargetLowering::TargetLowering(const TargetMachine &tm)
4242
: TargetLoweringBase(tm) {}
4343

44+
// Define the virtual destructor out-of-line for build efficiency.
45+
TargetLowering::~TargetLowering() = default;
46+
4447
const char *TargetLowering::getTargetNodeName(unsigned Opcode) const {
4548
return nullptr;
4649
}

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ TargetLoweringBase::TargetLoweringBase(const TargetMachine &tm)
668668
RTLIB::initCmpLibcallCCs(CmpLibcallCCs);
669669
}
670670

671+
// Define the virtual destructor out-of-line to act as a key method to anchor
672+
// debug info (see coding standards).
673+
TargetLoweringBase::~TargetLoweringBase() = default;
674+
671675
void TargetLoweringBase::initActions() {
672676
// All operations default to being supported.
673677
memset(OpActions, 0, sizeof(OpActions));

llvm/lib/Target/TargetMachine.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "llvm/MC/MCContext.h"
2222
#include "llvm/MC/MCInstrInfo.h"
2323
#include "llvm/MC/MCRegisterInfo.h"
24+
#include "llvm/MC/MCStreamer.h"
2425
#include "llvm/MC/MCSubtargetInfo.h"
2526
#include "llvm/Support/CodeGen.h"
2627
#include "llvm/Target/TargetLoweringObjectFile.h"
@@ -45,6 +46,14 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString,
4546

4647
TargetMachine::~TargetMachine() = default;
4748

49+
Expected<std::unique_ptr<MCStreamer>>
50+
TargetMachine::createMCStreamer(raw_pwrite_stream &Out,
51+
raw_pwrite_stream *DwoOut,
52+
CodeGenFileType FileType, MCContext &Ctx,
53+
raw_pwrite_stream *CasIDOS) {
54+
return nullptr;
55+
}
56+
4857
bool TargetMachine::isLargeGlobalValue(const GlobalValue *GVal) const {
4958
if (getTargetTriple().getArch() != Triple::x86_64)
5059
return false;

llvm/lib/Target/X86/X86Subtarget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ X86Subtarget::X86Subtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU,
361361
InstSelector.reset(createX86InstructionSelector(TM, *this, *RBI));
362362
}
363363

364+
// Define the virtual destructor out-of-line for build efficiency.
365+
X86Subtarget::~X86Subtarget() = default;
366+
364367
const CallLowering *X86Subtarget::getCallLowering() const {
365368
return CallLoweringInfo.get();
366369
}

llvm/lib/Target/X86/X86Subtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "X86ISelLowering.h"
1818
#include "X86InstrInfo.h"
1919
#include "X86SelectionDAGInfo.h"
20-
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
2120
#include "llvm/CodeGen/TargetSubtargetInfo.h"
2221
#include "llvm/IR/CallingConv.h"
2322
#include "llvm/TargetParser/Triple.h"
@@ -114,6 +113,7 @@ class X86Subtarget final : public X86GenSubtargetInfo {
114113
const X86TargetMachine &TM, MaybeAlign StackAlignOverride,
115114
unsigned PreferVectorWidthOverride,
116115
unsigned RequiredVectorWidth);
116+
~X86Subtarget() override;
117117

118118
const X86TargetLowering *getTargetLowering() const override {
119119
return &TLInfo;

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
//===----------------------------------------------------------------------===//
5050

5151
#include "X86TargetTransformInfo.h"
52+
#include "llvm/ADT/SmallBitVector.h"
5253
#include "llvm/Analysis/TargetTransformInfo.h"
5354
#include "llvm/CodeGen/BasicTTIImpl.h"
5455
#include "llvm/CodeGen/CostTable.h"

0 commit comments

Comments
 (0)