Skip to content

Commit cb6f7d1

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#4362)
2 parents eb515a2 + 54a23bc commit cb6f7d1

File tree

60 files changed

+1624
-1632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1624
-1632
lines changed

llvm/docs/GitHub.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,11 @@ branch. Just make sure to add the release milestone to the pull request.
567567
Getting admin access to CI infrastructure
568568
=========================================
569569

570-
Any individual who is responsible for setting up and/or maintaining CI infrastructure for a LLVM project can
571-
request to be granted the CI/CD role to the LLVM organization admins. The request can be made by creating
572-
`a Github issue <https://github.com/llvm/llvm-project/issues/new>`_ and using the ``infrastructure`` label.
573-
Applicants must include a justification for why the role is being requested. Applications are reviewed on a
574-
case-by-case basis by the LLVM admins and the role can be revoked at any point as the LLVM admins see fit.
570+
Any individual who is responsible for setting up and/or maintaining CI
571+
infrastructure for a LLVM project can request to be granted the CI/CD role by
572+
the LLVM infrastructure area team. The request can be made by creating `a
573+
Github issue <https://github.com/llvm/llvm-project/issues/new>`_ and using the
574+
``infrastructure`` label. Applicants must include a justification for why the
575+
role is being requested. Applications are reviewed on a case-by-case basis by
576+
the LLVM infrastructure area team and the role can be revoked at any point as
577+
the area team sees fit.

llvm/include/llvm/ADT/TypeSwitch.h

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "llvm/ADT/STLExtras.h"
1919
#include "llvm/Support/Casting.h"
20+
#include "llvm/Support/ErrorHandling.h"
2021
#include <optional>
2122

2223
namespace llvm {
@@ -117,11 +118,16 @@ class TypeSwitch : public detail::TypeSwitchBase<TypeSwitch<T, ResultT>, T> {
117118
return defaultResult;
118119
}
119120

120-
[[nodiscard]] operator ResultT() {
121-
assert(result && "Fell off the end of a type-switch");
122-
return std::move(*result);
121+
/// Declare default as unreachable, making sure that all cases were handled.
122+
[[nodiscard]] ResultT DefaultUnreachable(
123+
const char *message = "Fell off the end of a type-switch") {
124+
if (result)
125+
return std::move(*result);
126+
llvm_unreachable(message);
123127
}
124128

129+
[[nodiscard]] operator ResultT() { return DefaultUnreachable(); }
130+
125131
private:
126132
/// The pointer to the result of this switch statement, once known,
127133
/// null before that.
@@ -158,6 +164,13 @@ class TypeSwitch<T, void>
158164
defaultFn(this->value);
159165
}
160166

167+
/// Declare default as unreachable, making sure that all cases were handled.
168+
void DefaultUnreachable(
169+
const char *message = "Fell off the end of a type-switch") {
170+
if (!foundMatch)
171+
llvm_unreachable(message);
172+
}
173+
161174
private:
162175
/// A flag detailing if we have already found a match.
163176
bool foundMatch = false;

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,12 +1551,6 @@ class TargetTransformInfo {
15511551
OperandValueInfo OpdInfo = {OK_AnyValue, OP_None},
15521552
const Instruction *I = nullptr) const;
15531553

1554-
/// \return The cost of VP Load and Store instructions.
1555-
LLVM_ABI InstructionCost getVPMemoryOpCost(
1556-
unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace,
1557-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,
1558-
const Instruction *I = nullptr) const;
1559-
15601554
/// \return The cost of masked Load and Store instructions.
15611555
LLVM_ABI InstructionCost getMaskedMemoryOpCost(
15621556
unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace,

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -841,14 +841,6 @@ class TargetTransformInfoImplBase {
841841
return 1;
842842
}
843843

844-
virtual InstructionCost getVPMemoryOpCost(unsigned Opcode, Type *Src,
845-
Align Alignment,
846-
unsigned AddressSpace,
847-
TTI::TargetCostKind CostKind,
848-
const Instruction *I) const {
849-
return 1;
850-
}
851-
852844
virtual InstructionCost
853845
getMaskedMemoryOpCost(unsigned Opcode, Type *Src, Align Alignment,
854846
unsigned AddressSpace,

llvm/include/llvm/MC/MCAsmInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,10 @@ class LLVM_ABI MCAsmInfo {
469469
const char *getData64bitsDirective() const { return Data64bitsDirective; }
470470
bool supportsSignedData() const { return SupportsSignedData; }
471471

472-
/// Targets can implement this method to specify a section to switch to if the
473-
/// translation unit doesn't have any trampolines that require an executable
474-
/// stack.
475-
virtual MCSection *getNonexecutableStackSection(MCContext &Ctx) const {
472+
/// Targets can implement this method to specify a section to switch to
473+
/// depending on whether the translation unit has any trampolines that require
474+
/// an executable stack.
475+
virtual MCSection *getStackSection(MCContext &Ctx, bool Exec) const {
476476
return nullptr;
477477
}
478478

llvm/include/llvm/MC/MCAsmInfoELF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace llvm {
1515

1616
class MCAsmInfoELF : public MCAsmInfo {
1717
virtual void anchor();
18-
MCSection *getNonexecutableStackSection(MCContext &Ctx) const override;
18+
MCSection *getStackSection(MCContext &Ctx, bool Exec) const override;
1919
void printSwitchToSection(const MCSection &, uint32_t, const Triple &,
2020
raw_ostream &) const final;
2121
bool useCodeAlign(const MCSection &Sec) const final;

llvm/include/llvm/MC/TargetRegistry.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ class Target {
389389
/// @name Feature Constructors
390390
/// @{
391391

392+
// TODO(boomanaiden154): Remove this function after LLVM 22 branches.
392393
[[deprecated("Use overload accepting Triple instead")]]
393394
MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple,
394395
const MCTargetOptions &Options) const {
@@ -440,6 +441,7 @@ class Target {
440441
return MCInstrAnalysisCtorFn(Info);
441442
}
442443

444+
// TODO(boomanaiden154): Remove this function after LLVM 22 branches.
443445
[[deprecated("Use overload accepting Triple instead")]]
444446
MCRegisterInfo *createMCRegInfo(StringRef TT) const {
445447
if (!MCRegInfoCtorFn)
@@ -454,6 +456,7 @@ class Target {
454456
return MCRegInfoCtorFn(TT);
455457
}
456458

459+
// TODO(boomanaiden154): Remove this function after LLVM 22 branches.
457460
[[deprecated("Use overload accepting Triple instead")]]
458461
MCSubtargetInfo *createMCSubtargetInfo(StringRef TheTriple, StringRef CPU,
459462
StringRef Features) const {
@@ -496,16 +499,6 @@ class Target {
496499
JIT);
497500
}
498501

499-
[[deprecated("Use overload accepting Triple instead")]]
500-
TargetMachine *createTargetMachine(
501-
StringRef TT, StringRef CPU, StringRef Features,
502-
const TargetOptions &Options, std::optional<Reloc::Model> RM,
503-
std::optional<CodeModel::Model> CM = std::nullopt,
504-
CodeGenOptLevel OL = CodeGenOptLevel::Default, bool JIT = false) const {
505-
return createTargetMachine(Triple(TT), CPU, Features, Options, RM, CM, OL,
506-
JIT);
507-
}
508-
509502
/// createMCAsmBackend - Create a target specific assembly parser.
510503
MCAsmBackend *createMCAsmBackend(const MCSubtargetInfo &STI,
511504
const MCRegisterInfo &MRI,
@@ -599,6 +592,7 @@ class Target {
599592
return nullptr;
600593
}
601594

595+
// TODO(boomanaiden154): Remove this function after LLVM 22 branches.
602596
[[deprecated("Use overload accepting Triple instead")]]
603597
MCRelocationInfo *createMCRelocationInfo(StringRef TT, MCContext &Ctx) const {
604598
return createMCRelocationInfo(Triple(TT), Ctx);
@@ -616,6 +610,7 @@ class Target {
616610
return Fn(TT, Ctx);
617611
}
618612

613+
// TODO(boomanaiden154): Remove this function after LLVM 22 branches.
619614
[[deprecated("Use overload accepting Triple instead")]]
620615
MCSymbolizer *
621616
createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,9 +2907,11 @@ bool AsmPrinter::doFinalization(Module &M) {
29072907
// If we don't have any trampolines, then we don't require stack memory
29082908
// to be executable. Some targets have a directive to declare this.
29092909
Function *InitTrampolineIntrinsic = M.getFunction("llvm.init.trampoline");
2910-
if (!InitTrampolineIntrinsic || InitTrampolineIntrinsic->use_empty())
2911-
if (MCSection *S = MAI->getNonexecutableStackSection(OutContext))
2912-
OutStreamer->switchSection(S);
2910+
bool HasTrampolineUses =
2911+
InitTrampolineIntrinsic && !InitTrampolineIntrinsic->use_empty();
2912+
MCSection *S = MAI->getStackSection(OutContext, /*Exec=*/HasTrampolineUses);
2913+
if (S)
2914+
OutStreamer->switchSection(S);
29132915

29142916
if (TM.Options.EmitAddrsig) {
29152917
// Emit address-significance attributes for all globals.

llvm/lib/CodeGen/TargetInstrInfo.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,12 +1657,6 @@ bool TargetInstrInfo::isReMaterializableImpl(
16571657
// same virtual register, though.
16581658
if (MO.isDef() && Reg != DefReg)
16591659
return false;
1660-
1661-
// Don't allow any virtual-register uses. Rematting an instruction with
1662-
// virtual register uses would length the live ranges of the uses, which
1663-
// is not necessarily a good idea, certainly not "trivial".
1664-
if (MO.isUse())
1665-
return false;
16661660
}
16671661

16681662
// Everything checked out.

llvm/lib/MC/MCAsmInfoELF.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ using namespace llvm;
2727

2828
void MCAsmInfoELF::anchor() {}
2929

30-
MCSection *MCAsmInfoELF::getNonexecutableStackSection(MCContext &Ctx) const {
30+
MCSection *MCAsmInfoELF::getStackSection(MCContext &Ctx, bool Exec) const {
3131
// Solaris doesn't know/doesn't care about .note.GNU-stack sections, so
3232
// don't emit them.
3333
if (Ctx.getTargetTriple().isOSSolaris())
3434
return nullptr;
35-
return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS, 0);
35+
return Ctx.getELFSection(".note.GNU-stack", ELF::SHT_PROGBITS,
36+
Exec ? ELF::SHF_EXECINSTR : 0U);
3637
}
3738

3839
bool MCAsmInfoELF::useCodeAlign(const MCSection &Sec) const {

0 commit comments

Comments
 (0)