19.1.5 Release
This was a manual merge (via cherry-picks) of 3596372d003aead311700f86c282f3ebaafa36eb from the Fedora rawhide branch. Resolves: RHEL-70329 Resolves: RHEL-68697
This commit is contained in:
parent
c77b56b990
commit
feef242d2c
@ -1,41 +0,0 @@
|
||||
From d8742e9b361e5fd6fee2298b8ea0aeb4671ec05a Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npopov@redhat.com>
|
||||
Date: Wed, 22 May 2024 09:39:26 +0200
|
||||
Subject: [PATCH] Remove myst_parser dependency for RHEL
|
||||
|
||||
---
|
||||
clang/docs/conf.py | 3 +--
|
||||
llvm/docs/conf.py | 3 +--
|
||||
2 files changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
|
||||
index 4cee382a718f..d2e2198e05d4 100644
|
||||
--- a/clang/docs/conf.py
|
||||
+++ b/clang/docs/conf.py
|
||||
@@ -43,8 +43,7 @@ try:
|
||||
|
||||
extensions.append("myst_parser")
|
||||
except ImportError:
|
||||
- if not tags.has("builder-man"):
|
||||
- raise
|
||||
+ pass
|
||||
|
||||
|
||||
# The encoding of source files.
|
||||
diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py
|
||||
index 7f2ed5309606..354a41f11280 100644
|
||||
--- a/llvm/docs/conf.py
|
||||
+++ b/llvm/docs/conf.py
|
||||
@@ -36,8 +36,7 @@ try:
|
||||
|
||||
extensions.append("myst_parser")
|
||||
except ImportError:
|
||||
- if not tags.has("builder-man"):
|
||||
- raise
|
||||
+ pass
|
||||
|
||||
# Automatic anchors for markdown titles
|
||||
from llvm_slug import make_slug
|
||||
--
|
||||
2.44.0
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 50cd36c2156d375a6d50f661908b460fbbd22e78 Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npopov@redhat.com>
|
||||
Date: Wed, 22 May 2024 09:39:26 +0200
|
||||
Subject: [PATCH] Remove myst_parser dependency for RHEL
|
||||
|
||||
---
|
||||
clang/docs/conf.py | 3 +--
|
||||
llvm/docs/conf.py | 5 +----
|
||||
2 files changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/clang/docs/conf.py b/clang/docs/conf.py
|
||||
index 4cee382a718f..d2e2198e05d4 100644
|
||||
--- a/clang/docs/conf.py
|
||||
+++ b/clang/docs/conf.py
|
||||
@@ -43,8 +43,7 @@ try:
|
||||
|
||||
extensions.append("myst_parser")
|
||||
except ImportError:
|
||||
- if not tags.has("builder-man"):
|
||||
- raise
|
||||
+ pass
|
||||
|
||||
|
||||
# The encoding of source files.
|
||||
diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py
|
||||
index d9fa6961032b..e38c009a457d 100644
|
||||
--- a/llvm/docs/conf.py
|
||||
+++ b/llvm/docs/conf.py
|
||||
@@ -36,10 +36,7 @@ try:
|
||||
|
||||
extensions.append("myst_parser")
|
||||
except ImportError:
|
||||
- if not tags.has("builder-man"):
|
||||
- raise
|
||||
-else:
|
||||
- myst_enable_extensions = ["substitution"]
|
||||
+ pass
|
||||
|
||||
# Automatic anchors for markdown titles
|
||||
myst_heading_anchors = 6
|
||||
--
|
||||
2.46.0
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 73d3b4047d757ef35850e2cef38285b96be82f0f Mon Sep 17 00:00:00 2001
|
||||
From: Nikita Popov <npopov@redhat.com>
|
||||
Date: Tue, 23 May 2023 12:17:29 +0200
|
||||
Subject: [PATCH] [Driver] Give devtoolset path precedence over InstalledDir
|
||||
|
||||
This is a followup to the change from c5fe10f365247c3dd9416b7ec8bad73a60b5946e.
|
||||
While that commit correctly adds the bindir from devtoolset to the
|
||||
path, the driver dir / install dir still comes first. This means
|
||||
we'll still end up picking /usr/bin/ld rather than the one from
|
||||
devtoolset.
|
||||
|
||||
Unfortunately, I don't see any way to test this. In the environment
|
||||
the tests are run, this would only result in a behavior difference
|
||||
if there is an ld binary present in the LLVM build directory, which
|
||||
isn't the case.
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D151203
|
||||
---
|
||||
clang/lib/Driver/ToolChains/Linux.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
|
||||
index 853ff99d9fe5..aecabb46d4b9 100644
|
||||
--- a/clang/lib/Driver/ToolChains/Linux.cpp
|
||||
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
|
||||
@@ -244,9 +244,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
||||
// With devtoolset on RHEL, we want to add a bin directory that is relative
|
||||
// to the detected gcc install, because if we are using devtoolset gcc then
|
||||
// we want to use other tools from devtoolset (e.g. ld) instead of the
|
||||
- // standard system tools.
|
||||
- PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
|
||||
- "/../bin").str());
|
||||
+ // standard system tools. This should take precedence over InstalledDir.
|
||||
+ PPaths.insert(PPaths.begin(),
|
||||
+ Twine(GCCInstallation.getParentLibPath() + "/../bin").str());
|
||||
|
||||
if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
|
||||
ExtraOpts.push_back("-X");
|
||||
--
|
||||
2.40.1
|
||||
|
@ -0,0 +1,86 @@
|
||||
From ccc2b792e57d632bc887b226a4e7f0a8189eab8b Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Mon, 4 Nov 2024 16:37:49 -0800
|
||||
Subject: [PATCH] [profile] Use base+vaddr for `__llvm_write_binary_ids` note
|
||||
pointers
|
||||
|
||||
This function is always examining its own ELF headers in memory, but it
|
||||
was trying to use conditions between examining files or memory, and it
|
||||
wasn't accounting for LOAD offsets at runtime. This is especially bad if
|
||||
a loaded segment has additional padding that's not in the file offsets.
|
||||
|
||||
Now we do a first scan of the program headers to figure out the runtime
|
||||
base address based on `PT_PHDR` and/or `PT_DYNAMIC` (else assume zero),
|
||||
similar to libc's `do_start`. Then each `PT_NOTE` pointer is simply the
|
||||
base plus the segments's `pt_vaddr`, which includes LOAD offsets.
|
||||
|
||||
Fixes #114605
|
||||
---
|
||||
.../lib/profile/InstrProfilingPlatformLinux.c | 40 ++++++++-----------
|
||||
1 file changed, 16 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
|
||||
index e2c06d51e0c6..c365129a0768 100644
|
||||
--- a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
|
||||
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c
|
||||
@@ -194,41 +194,33 @@ static int WriteBinaryIds(ProfDataWriter *Writer, const ElfW(Nhdr) * Note,
|
||||
*/
|
||||
COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) {
|
||||
extern const ElfW(Ehdr) __ehdr_start __attribute__((visibility("hidden")));
|
||||
+ extern ElfW(Dyn) _DYNAMIC[] __attribute__((weak, visibility("hidden")));
|
||||
+
|
||||
const ElfW(Ehdr) *ElfHeader = &__ehdr_start;
|
||||
const ElfW(Phdr) *ProgramHeader =
|
||||
(const ElfW(Phdr) *)((uintptr_t)ElfHeader + ElfHeader->e_phoff);
|
||||
|
||||
+ /* Compute the added base address in case of position-independent code. */
|
||||
+ uintptr_t Base = 0;
|
||||
+ for (uint32_t I = 0; I < ElfHeader->e_phnum; I++) {
|
||||
+ if (ProgramHeader[I].p_type == PT_PHDR)
|
||||
+ Base = (uintptr_t)ProgramHeader - ProgramHeader[I].p_vaddr;
|
||||
+ if (ProgramHeader[I].p_type == PT_DYNAMIC && _DYNAMIC)
|
||||
+ Base = (uintptr_t)_DYNAMIC - ProgramHeader[I].p_vaddr;
|
||||
+ }
|
||||
+
|
||||
int TotalBinaryIdsSize = 0;
|
||||
- uint32_t I;
|
||||
/* Iterate through entries in the program header. */
|
||||
- for (I = 0; I < ElfHeader->e_phnum; I++) {
|
||||
+ for (uint32_t I = 0; I < ElfHeader->e_phnum; I++) {
|
||||
/* Look for the notes segment in program header entries. */
|
||||
if (ProgramHeader[I].p_type != PT_NOTE)
|
||||
continue;
|
||||
|
||||
/* There can be multiple notes segment, and examine each of them. */
|
||||
- const ElfW(Nhdr) * Note;
|
||||
- const ElfW(Nhdr) * NotesEnd;
|
||||
- /*
|
||||
- * When examining notes in file, use p_offset, which is the offset within
|
||||
- * the elf file, to find the start of notes.
|
||||
- */
|
||||
- if (ProgramHeader[I].p_memsz == 0 ||
|
||||
- ProgramHeader[I].p_memsz == ProgramHeader[I].p_filesz) {
|
||||
- Note = (const ElfW(Nhdr) *)((uintptr_t)ElfHeader +
|
||||
- ProgramHeader[I].p_offset);
|
||||
- NotesEnd = (const ElfW(Nhdr) *)((const char *)(Note) +
|
||||
- ProgramHeader[I].p_filesz);
|
||||
- } else {
|
||||
- /*
|
||||
- * When examining notes in memory, use p_vaddr, which is the address of
|
||||
- * section after loaded to memory, to find the start of notes.
|
||||
- */
|
||||
- Note =
|
||||
- (const ElfW(Nhdr) *)((uintptr_t)ElfHeader + ProgramHeader[I].p_vaddr);
|
||||
- NotesEnd =
|
||||
- (const ElfW(Nhdr) *)((const char *)(Note) + ProgramHeader[I].p_memsz);
|
||||
- }
|
||||
+ const ElfW(Nhdr) *Note =
|
||||
+ (const ElfW(Nhdr) *)(Base + ProgramHeader[I].p_vaddr);
|
||||
+ const ElfW(Nhdr) *NotesEnd =
|
||||
+ (const ElfW(Nhdr) *)((const char *)(Note) + ProgramHeader[I].p_memsz);
|
||||
|
||||
int BinaryIdsSize = WriteBinaryIds(Writer, Note, NotesEnd);
|
||||
if (TotalBinaryIdsSize == -1)
|
||||
--
|
||||
2.47.0
|
||||
|
893
18-99273.patch
Normal file
893
18-99273.patch
Normal file
@ -0,0 +1,893 @@
|
||||
From 91052169960477fbc39169c10f9fae3bec732510 Mon Sep 17 00:00:00 2001
|
||||
From: Carl Ritson <carl.ritson@amd.com>
|
||||
Date: Wed, 17 Jul 2024 15:07:42 +0900
|
||||
Subject: [PATCH 1/3] [AMDGPU] Implement workaround for GFX11.5 export priority
|
||||
|
||||
On GFX11.5 shaders having completed exports need to execute/wait
|
||||
at a lower priority than shaders still executing exports.
|
||||
Add code to maintain normal priority of 2 for shaders that export
|
||||
and drop to priority 0 after exports.
|
||||
---
|
||||
llvm/lib/Target/AMDGPU/AMDGPU.td | 15 +-
|
||||
.../lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 112 ++++++
|
||||
llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h | 1 +
|
||||
llvm/lib/Target/AMDGPU/GCNSubtarget.h | 3 +
|
||||
.../AMDGPU/required-export-priority.ll | 344 ++++++++++++++++++
|
||||
.../AMDGPU/required-export-priority.mir | 293 +++++++++++++++
|
||||
6 files changed, 765 insertions(+), 3 deletions(-)
|
||||
create mode 100644 llvm/test/CodeGen/AMDGPU/required-export-priority.ll
|
||||
create mode 100644 llvm/test/CodeGen/AMDGPU/required-export-priority.mir
|
||||
|
||||
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
|
||||
index dfc8eaea66f7b..14fcf6a210a78 100644
|
||||
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
|
||||
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
|
||||
@@ -947,6 +947,12 @@ def FeatureHasRestrictedSOffset : SubtargetFeature<"restricted-soffset",
|
||||
"Has restricted SOffset (immediate not supported)."
|
||||
>;
|
||||
|
||||
+def FeatureRequiredExportPriority : SubtargetFeature<"required-export-priority",
|
||||
+ "HasRequiredExportPriority",
|
||||
+ "true",
|
||||
+ "Export priority must be explicitly manipulated on GFX11.5"
|
||||
+>;
|
||||
+
|
||||
//===------------------------------------------------------------===//
|
||||
// Subtarget Features (options and debugging)
|
||||
//===------------------------------------------------------------===//
|
||||
@@ -1597,14 +1603,16 @@ def FeatureISAVersion11_5_0 : FeatureSet<
|
||||
!listconcat(FeatureISAVersion11_Common.Features,
|
||||
[FeatureSALUFloatInsts,
|
||||
FeatureDPPSrc1SGPR,
|
||||
- FeatureVGPRSingleUseHintInsts])>;
|
||||
+ FeatureVGPRSingleUseHintInsts,
|
||||
+ FeatureRequiredExportPriority])>;
|
||||
|
||||
def FeatureISAVersion11_5_1 : FeatureSet<
|
||||
!listconcat(FeatureISAVersion11_Common.Features,
|
||||
[FeatureSALUFloatInsts,
|
||||
FeatureDPPSrc1SGPR,
|
||||
FeatureVGPRSingleUseHintInsts,
|
||||
- FeatureGFX11FullVGPRs])>;
|
||||
+ FeatureGFX11FullVGPRs,
|
||||
+ FeatureRequiredExportPriority])>;
|
||||
|
||||
def FeatureISAVersion12 : FeatureSet<
|
||||
[FeatureGFX12,
|
||||
diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
|
||||
index a402fc6d7e611..a8b171aa82840 100644
|
||||
--- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
|
||||
+++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "GCNSubtarget.h"
|
||||
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
|
||||
#include "SIMachineFunctionInfo.h"
|
||||
+#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/ScheduleDAG.h"
|
||||
#include "llvm/TargetParser/TargetParser.h"
|
||||
@@ -1104,6 +1105,7 @@ void GCNHazardRecognizer::fixHazards(MachineInstr *MI) {
|
||||
fixWMMAHazards(MI);
|
||||
fixShift64HighRegBug(MI);
|
||||
fixVALUMaskWriteHazard(MI);
|
||||
+ fixRequiredExportPriority(MI);
|
||||
}
|
||||
|
||||
bool GCNHazardRecognizer::fixVcmpxPermlaneHazards(MachineInstr *MI) {
|
||||
@@ -2895,3 +2897,113 @@ bool GCNHazardRecognizer::fixVALUMaskWriteHazard(MachineInstr *MI) {
|
||||
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+static bool ensureEntrySetPrio(MachineFunction *MF, int Priority,
|
||||
+ const SIInstrInfo &TII) {
|
||||
+ MachineBasicBlock &EntryMBB = MF->front();
|
||||
+ if (EntryMBB.begin() != EntryMBB.end()) {
|
||||
+ auto &EntryMI = *EntryMBB.begin();
|
||||
+ if (EntryMI.getOpcode() == AMDGPU::S_SETPRIO &&
|
||||
+ EntryMI.getOperand(0).getImm() >= Priority)
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ BuildMI(EntryMBB, EntryMBB.begin(), DebugLoc(), TII.get(AMDGPU::S_SETPRIO))
|
||||
+ .addImm(Priority);
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool GCNHazardRecognizer::fixRequiredExportPriority(MachineInstr *MI) {
|
||||
+ if (!ST.hasRequiredExportPriority())
|
||||
+ return false;
|
||||
+
|
||||
+ // Assume the following shader types will never have exports,
|
||||
+ // and avoid adding or adjusting S_SETPRIO.
|
||||
+ MachineBasicBlock *MBB = MI->getParent();
|
||||
+ MachineFunction *MF = MBB->getParent();
|
||||
+ auto CC = MF->getFunction().getCallingConv();
|
||||
+ switch (CC) {
|
||||
+ case CallingConv::AMDGPU_CS:
|
||||
+ case CallingConv::AMDGPU_CS_Chain:
|
||||
+ case CallingConv::AMDGPU_CS_ChainPreserve:
|
||||
+ case CallingConv::AMDGPU_KERNEL:
|
||||
+ return false;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ const int MaxPriority = 3;
|
||||
+ const int NormalPriority = 2;
|
||||
+ const int PostExportPriority = 0;
|
||||
+
|
||||
+ auto It = MI->getIterator();
|
||||
+ switch (MI->getOpcode()) {
|
||||
+ case AMDGPU::S_ENDPGM:
|
||||
+ case AMDGPU::S_ENDPGM_SAVED:
|
||||
+ case AMDGPU::S_ENDPGM_ORDERED_PS_DONE:
|
||||
+ case AMDGPU::SI_RETURN_TO_EPILOG:
|
||||
+ // Ensure shader with calls raises priority at entry.
|
||||
+ // This ensures correct priority if exports exist in callee.
|
||||
+ if (MF->getFrameInfo().hasCalls())
|
||||
+ return ensureEntrySetPrio(MF, NormalPriority, TII);
|
||||
+ return false;
|
||||
+ case AMDGPU::S_SETPRIO: {
|
||||
+ // Raise minimum priority unless in workaround.
|
||||
+ auto &PrioOp = MI->getOperand(0);
|
||||
+ int Prio = PrioOp.getImm();
|
||||
+ bool InWA = (Prio == PostExportPriority) &&
|
||||
+ (It != MBB->begin() && TII.isEXP(*std::prev(It)));
|
||||
+ if (InWA || Prio >= NormalPriority)
|
||||
+ return false;
|
||||
+ PrioOp.setImm(std::min(Prio + NormalPriority, MaxPriority));
|
||||
+ return true;
|
||||
+ }
|
||||
+ default:
|
||||
+ if (!TII.isEXP(*MI))
|
||||
+ return false;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ // Check entry priority at each export (as there will only be a few).
|
||||
+ // Note: amdgpu_gfx can only be a callee, so defer to caller setprio.
|
||||
+ bool Changed = false;
|
||||
+ if (CC != CallingConv::AMDGPU_Gfx)
|
||||
+ Changed = ensureEntrySetPrio(MF, NormalPriority, TII);
|
||||
+
|
||||
+ auto NextMI = std::next(It);
|
||||
+ bool EndOfShader = false;
|
||||
+ if (NextMI != MBB->end()) {
|
||||
+ // Only need WA at end of sequence of exports.
|
||||
+ if (TII.isEXP(*NextMI))
|
||||
+ return Changed;
|
||||
+ // Assume appropriate S_SETPRIO after export means WA already applied.
|
||||
+ if (NextMI->getOpcode() == AMDGPU::S_SETPRIO &&
|
||||
+ NextMI->getOperand(0).getImm() == PostExportPriority)
|
||||
+ return Changed;
|
||||
+ EndOfShader = NextMI->getOpcode() == AMDGPU::S_ENDPGM;
|
||||
+ }
|
||||
+
|
||||
+ const DebugLoc &DL = MI->getDebugLoc();
|
||||
+
|
||||
+ // Lower priority.
|
||||
+ BuildMI(*MBB, NextMI, DL, TII.get(AMDGPU::S_SETPRIO))
|
||||
+ .addImm(PostExportPriority);
|
||||
+
|
||||
+ if (!EndOfShader) {
|
||||
+ // Wait for exports to complete.
|
||||
+ BuildMI(*MBB, NextMI, DL, TII.get(AMDGPU::S_WAITCNT_EXPCNT))
|
||||
+ .addReg(AMDGPU::SGPR_NULL)
|
||||
+ .addImm(0);
|
||||
+ }
|
||||
+
|
||||
+ BuildMI(*MBB, NextMI, DL, TII.get(AMDGPU::S_NOP)).addImm(0);
|
||||
+ BuildMI(*MBB, NextMI, DL, TII.get(AMDGPU::S_NOP)).addImm(0);
|
||||
+
|
||||
+ if (!EndOfShader) {
|
||||
+ // Return to normal (higher) priority.
|
||||
+ BuildMI(*MBB, NextMI, DL, TII.get(AMDGPU::S_SETPRIO))
|
||||
+ .addImm(NormalPriority);
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
|
||||
index 3ccca527c626b..f2a64ab48e180 100644
|
||||
--- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
|
||||
+++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h
|
||||
@@ -107,6 +107,7 @@ class GCNHazardRecognizer final : public ScheduleHazardRecognizer {
|
||||
bool fixWMMAHazards(MachineInstr *MI);
|
||||
bool fixShift64HighRegBug(MachineInstr *MI);
|
||||
bool fixVALUMaskWriteHazard(MachineInstr *MI);
|
||||
+ bool fixRequiredExportPriority(MachineInstr *MI);
|
||||
|
||||
int checkMAIHazards(MachineInstr *MI);
|
||||
int checkMAIHazards908(MachineInstr *MI);
|
||||
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
|
||||
index e5817594a4521..def89c785b855 100644
|
||||
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
|
||||
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
|
||||
@@ -238,6 +238,7 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
|
||||
bool HasVOPDInsts = false;
|
||||
bool HasVALUTransUseHazard = false;
|
||||
bool HasForceStoreSC0SC1 = false;
|
||||
+ bool HasRequiredExportPriority = false;
|
||||
|
||||
// Dummy feature to use for assembler in tablegen.
|
||||
bool FeatureDisable = false;
|
||||
@@ -1282,6 +1283,8 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
|
||||
|
||||
bool hasRestrictedSOffset() const { return HasRestrictedSOffset; }
|
||||
|
||||
+ bool hasRequiredExportPriority() const { return HasRequiredExportPriority; }
|
||||
+
|
||||
/// \returns true if the target uses LOADcnt/SAMPLEcnt/BVHcnt, DScnt/KMcnt
|
||||
/// and STOREcnt rather than VMcnt, LGKMcnt and VScnt respectively.
|
||||
bool hasExtendedWaitCounts() const { return getGeneration() >= GFX12; }
|
||||
diff --git a/llvm/test/CodeGen/AMDGPU/required-export-priority.ll b/llvm/test/CodeGen/AMDGPU/required-export-priority.ll
|
||||
new file mode 100644
|
||||
index 0000000000000..377902f3f0d1a
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/CodeGen/AMDGPU/required-export-priority.ll
|
||||
@@ -0,0 +1,344 @@
|
||||
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
|
||||
+; RUN: llc -mtriple=amdgcn -mcpu=gfx1150 -amdgpu-enable-vopd=0 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
|
||||
+
|
||||
+define amdgpu_ps void @test_export_zeroes_f32() #0 {
|
||||
+; GCN-LABEL: test_export_zeroes_f32:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: v_mov_b32_e32 v0, 0
|
||||
+; GCN-NEXT: exp mrt0 off, off, off, off
|
||||
+; GCN-NEXT: exp mrt0 off, off, off, off done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 0, float 0.0, float 0.0, float 0.0, float 0.0, i1 false, i1 false)
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 0, float 0.0, float 0.0, float 0.0, float 0.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_export_en_src0_f32() #0 {
|
||||
+; GCN-LABEL: test_export_en_src0_f32:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: v_mov_b32_e32 v0, 4.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 0.5
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 2.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 1.0
|
||||
+; GCN-NEXT: exp mrt0 v3, off, off, off done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 1, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_gs void @test_export_gs() #0 {
|
||||
+; GCN-LABEL: test_export_gs:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: v_mov_b32_e32 v0, 4.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 0.5
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 2.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 1.0
|
||||
+; GCN-NEXT: exp mrt0 off, v2, off, off done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_hs void @test_export_hs() #0 {
|
||||
+; GCN-LABEL: test_export_hs:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: v_mov_b32_e32 v0, 4.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 0.5
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 2.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 1.0
|
||||
+; GCN-NEXT: exp mrt0 off, v2, off, off done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_gfx void @test_export_gfx(float %v) #0 {
|
||||
+; GCN-LABEL: test_export_gfx:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 4.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 0.5
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 2.0
|
||||
+; GCN-NEXT: exp mrt0 off, v3, off, off done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_waitcnt_expcnt null, 0x0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_waitcnt expcnt(0)
|
||||
+; GCN-NEXT: s_setpc_b64 s[30:31]
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float %v, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_cs void @test_export_cs() #0 {
|
||||
+; GCN-LABEL: test_export_cs:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: v_mov_b32_e32 v0, 4.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 0.5
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 2.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 1.0
|
||||
+; GCN-NEXT: exp mrt0 off, v2, off, off done
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_kernel void @test_export_kernel() #0 {
|
||||
+; GCN-LABEL: test_export_kernel:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: v_mov_b32_e32 v0, 4.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 0.5
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 2.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 1.0
|
||||
+; GCN-NEXT: exp mrt0 off, v2, off, off done
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 2, float 1.0, float 2.0, float 0.5, float 4.0, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_gfx void @test_no_export_gfx(float %v) #0 {
|
||||
+; GCN-LABEL: test_no_export_gfx:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
||||
+; GCN-NEXT: s_setpc_b64 s[30:31]
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_no_export_ps(float %v) #0 {
|
||||
+; GCN-LABEL: test_no_export_ps:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_if_export_f32(i32 %flag, float %x, float %y, float %z, float %w) #0 {
|
||||
+; GCN-LABEL: test_if_export_f32:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_mov_b32 s0, exec_lo
|
||||
+; GCN-NEXT: v_cmpx_ne_u32_e32 0, v0
|
||||
+; GCN-NEXT: s_cbranch_execz .LBB9_2
|
||||
+; GCN-NEXT: ; %bb.1: ; %exp
|
||||
+; GCN-NEXT: exp mrt0 v1, v2, v3, v4
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_waitcnt_expcnt null, 0x0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: .LBB9_2: ; %end
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %cc = icmp eq i32 %flag, 0
|
||||
+ br i1 %cc, label %end, label %exp
|
||||
+
|
||||
+exp:
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float %x, float %y, float %z, float %w, i1 false, i1 false)
|
||||
+ br label %end
|
||||
+
|
||||
+end:
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_if_export_vm_f32(i32 %flag, float %x, float %y, float %z, float %w) #0 {
|
||||
+; GCN-LABEL: test_if_export_vm_f32:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_mov_b32 s0, exec_lo
|
||||
+; GCN-NEXT: v_cmpx_ne_u32_e32 0, v0
|
||||
+; GCN-NEXT: s_cbranch_execz .LBB10_2
|
||||
+; GCN-NEXT: ; %bb.1: ; %exp
|
||||
+; GCN-NEXT: exp mrt0 v1, v2, v3, v4
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_waitcnt_expcnt null, 0x0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: .LBB10_2: ; %end
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %cc = icmp eq i32 %flag, 0
|
||||
+ br i1 %cc, label %end, label %exp
|
||||
+
|
||||
+exp:
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float %x, float %y, float %z, float %w, i1 false, i1 true)
|
||||
+ br label %end
|
||||
+
|
||||
+end:
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_if_export_done_f32(i32 %flag, float %x, float %y, float %z, float %w) #0 {
|
||||
+; GCN-LABEL: test_if_export_done_f32:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_mov_b32 s0, exec_lo
|
||||
+; GCN-NEXT: v_cmpx_ne_u32_e32 0, v0
|
||||
+; GCN-NEXT: s_cbranch_execz .LBB11_2
|
||||
+; GCN-NEXT: ; %bb.1: ; %exp
|
||||
+; GCN-NEXT: exp mrt0 v1, v2, v3, v4 done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_waitcnt_expcnt null, 0x0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: .LBB11_2: ; %end
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %cc = icmp eq i32 %flag, 0
|
||||
+ br i1 %cc, label %end, label %exp
|
||||
+
|
||||
+exp:
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float %x, float %y, float %z, float %w, i1 true, i1 false)
|
||||
+ br label %end
|
||||
+
|
||||
+end:
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_if_export_vm_done_f32(i32 %flag, float %x, float %y, float %z, float %w) #0 {
|
||||
+; GCN-LABEL: test_if_export_vm_done_f32:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_mov_b32 s0, exec_lo
|
||||
+; GCN-NEXT: v_cmpx_ne_u32_e32 0, v0
|
||||
+; GCN-NEXT: s_cbranch_execz .LBB12_2
|
||||
+; GCN-NEXT: ; %bb.1: ; %exp
|
||||
+; GCN-NEXT: exp mrt0 v1, v2, v3, v4 done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_waitcnt_expcnt null, 0x0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: .LBB12_2: ; %end
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %cc = icmp eq i32 %flag, 0
|
||||
+ br i1 %cc, label %end, label %exp
|
||||
+
|
||||
+exp:
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float %x, float %y, float %z, float %w, i1 true, i1 true)
|
||||
+ br label %end
|
||||
+
|
||||
+end:
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_export_pos_before_param_across_load(i32 %idx) #0 {
|
||||
+; GCN-LABEL: test_export_pos_before_param_across_load:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: buffer_load_b32 v0, v0, s[0:3], 0 offen
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 1.0
|
||||
+; GCN-NEXT: v_mov_b32_e32 v3, 0.5
|
||||
+; GCN-NEXT: s_waitcnt vmcnt(0)
|
||||
+; GCN-NEXT: exp pos0 v1, v1, v1, v0 done
|
||||
+; GCN-NEXT: exp invalid_target_32 v2, v2, v2, v2
|
||||
+; GCN-NEXT: exp invalid_target_33 v2, v2, v2, v3
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float 1.0, float 1.0, float 1.0, float 1.0, i1 false, i1 false)
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 33, i32 15, float 1.0, float 1.0, float 1.0, float 0.5, i1 false, i1 false)
|
||||
+ %load = call float @llvm.amdgcn.raw.ptr.buffer.load.f32(ptr addrspace(8) undef, i32 %idx, i32 0, i32 0)
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 12, i32 15, float 0.0, float 0.0, float 0.0, float %load, i1 true, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_export_across_store_load(i32 %idx, float %v) #0 {
|
||||
+; GCN-LABEL: test_export_across_store_load:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 24
|
||||
+; GCN-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v0
|
||||
+; GCN-NEXT: s_delay_alu instid0(VALU_DEP_2)
|
||||
+; GCN-NEXT: v_cndmask_b32_e64 v0, v2, 8, vcc_lo
|
||||
+; GCN-NEXT: v_mov_b32_e32 v2, 0
|
||||
+; GCN-NEXT: scratch_store_b32 v0, v1, off
|
||||
+; GCN-NEXT: scratch_load_b32 v0, off, off
|
||||
+; GCN-NEXT: v_mov_b32_e32 v1, 1.0
|
||||
+; GCN-NEXT: exp pos0 v2, v2, v2, v1 done
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_waitcnt_expcnt null, 0x0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_waitcnt vmcnt(0)
|
||||
+; GCN-NEXT: exp invalid_target_32 v0, v2, v1, v2
|
||||
+; GCN-NEXT: exp invalid_target_33 v0, v2, v1, v2
|
||||
+; GCN-NEXT: s_setprio 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_nop 0
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %data0 = alloca <4 x float>, align 8, addrspace(5)
|
||||
+ %data1 = alloca <4 x float>, align 8, addrspace(5)
|
||||
+ %cmp = icmp eq i32 %idx, 1
|
||||
+ %data = select i1 %cmp, ptr addrspace(5) %data0, ptr addrspace(5) %data1
|
||||
+ store float %v, ptr addrspace(5) %data, align 8
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 12, i32 15, float 0.0, float 0.0, float 0.0, float 1.0, i1 true, i1 false)
|
||||
+ %load0 = load float, ptr addrspace(5) %data0, align 8
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %load0, float 0.0, float 1.0, float 0.0, i1 false, i1 false)
|
||||
+ call void @llvm.amdgcn.exp.f32(i32 33, i32 15, float %load0, float 0.0, float 1.0, float 0.0, i1 false, i1 false)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_export_in_callee(float %v) #0 {
|
||||
+; GCN-LABEL: test_export_in_callee:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_getpc_b64 s[0:1]
|
||||
+; GCN-NEXT: s_add_u32 s0, s0, test_export_gfx@gotpcrel32@lo+4
|
||||
+; GCN-NEXT: s_addc_u32 s1, s1, test_export_gfx@gotpcrel32@hi+12
|
||||
+; GCN-NEXT: v_add_f32_e32 v0, 1.0, v0
|
||||
+; GCN-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
|
||||
+; GCN-NEXT: s_mov_b32 s32, 0
|
||||
+; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
||||
+; GCN-NEXT: s_swappc_b64 s[30:31], s[0:1]
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %x = fadd float %v, 1.0
|
||||
+ call void @test_export_gfx(float %x)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+define amdgpu_ps void @test_export_in_callee_prio(float %v) #0 {
|
||||
+; GCN-LABEL: test_export_in_callee_prio:
|
||||
+; GCN: ; %bb.0:
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_mov_b32 s32, 0
|
||||
+; GCN-NEXT: v_add_f32_e32 v0, 1.0, v0
|
||||
+; GCN-NEXT: s_setprio 2
|
||||
+; GCN-NEXT: s_getpc_b64 s[0:1]
|
||||
+; GCN-NEXT: s_add_u32 s0, s0, test_export_gfx@gotpcrel32@lo+4
|
||||
+; GCN-NEXT: s_addc_u32 s1, s1, test_export_gfx@gotpcrel32@hi+12
|
||||
+; GCN-NEXT: s_load_b64 s[0:1], s[0:1], 0x0
|
||||
+; GCN-NEXT: s_waitcnt lgkmcnt(0)
|
||||
+; GCN-NEXT: s_swappc_b64 s[30:31], s[0:1]
|
||||
+; GCN-NEXT: s_endpgm
|
||||
+ %x = fadd float %v, 1.0
|
||||
+ call void @llvm.amdgcn.s.setprio(i16 0)
|
||||
+ call void @test_export_gfx(float %x)
|
||||
+ ret void
|
||||
+}
|
||||
+
|
||||
+declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #1
|
||||
+declare void @llvm.amdgcn.exp.i32(i32, i32, i32, i32, i32, i32, i1, i1) #1
|
||||
+declare float @llvm.amdgcn.raw.ptr.buffer.load.f32(ptr addrspace(8), i32, i32, i32) #2
|
||||
+declare void @llvm.amdgcn.s.setprio(i16)
|
||||
+
|
||||
+attributes #0 = { nounwind }
|
||||
+attributes #1 = { nounwind inaccessiblememonly }
|
||||
+attributes #2 = { nounwind readnone }
|
||||
diff --git a/llvm/test/CodeGen/AMDGPU/required-export-priority.mir b/llvm/test/CodeGen/AMDGPU/required-export-priority.mir
|
||||
new file mode 100644
|
||||
index 0000000000000..eee04468036e5
|
||||
--- /dev/null
|
||||
+++ b/llvm/test/CodeGen/AMDGPU/required-export-priority.mir
|
||||
@@ -0,0 +1,293 @@
|
||||
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
|
||||
+# RUN: llc -mtriple=amdgcn -mcpu=gfx1150 -mattr=-wavefrontsize32,+wavefrontsize64 -run-pass=post-RA-hazard-rec -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GFX1150 %s
|
||||
+
|
||||
+--- |
|
||||
+ define amdgpu_ps void @end_of_shader() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @end_of_shader_return_to_epilogue() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @end_of_block() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @start_of_block() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @block_of_exports() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @sparse_exports() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @existing_setprio_1() {
|
||||
+ ret void
|
||||
+ }
|
||||
+ define amdgpu_ps void @existing_setprio_2() {
|
||||
+ ret void
|
||||
+ }
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: end_of_shader
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ ; GFX1150-LABEL: name: end_of_shader
|
||||
+ ; GFX1150: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: end_of_shader_return_to_epilogue
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ ; GFX1150-LABEL: name: end_of_shader_return_to_epilogue
|
||||
+ ; GFX1150: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_WAITCNT_EXPCNT $sgpr_null, 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: SI_RETURN_TO_EPILOG $vgpr0
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ SI_RETURN_TO_EPILOG $vgpr0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: end_of_block
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ ; GFX1150-LABEL: name: end_of_block
|
||||
+ ; GFX1150: bb.0:
|
||||
+ ; GFX1150-NEXT: successors: %bb.1(0x80000000)
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_WAITCNT_EXPCNT $sgpr_null, 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: bb.1:
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+
|
||||
+ bb.1:
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: start_of_block
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ ; GFX1150-LABEL: name: start_of_block
|
||||
+ ; GFX1150: bb.0:
|
||||
+ ; GFX1150-NEXT: successors: %bb.1(0x80000000)
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: bb.1:
|
||||
+ ; GFX1150-NEXT: successors: %bb.2(0x80000000)
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_WAITCNT_EXPCNT $sgpr_null, 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: bb.2:
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+
|
||||
+ bb.1:
|
||||
+ liveins: $vgpr0
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+
|
||||
+ bb.2:
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: block_of_exports
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ ; GFX1150-LABEL: name: block_of_exports
|
||||
+ ; GFX1150: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: EXP 2, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ EXP 2, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: sparse_exports
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ ; GFX1150-LABEL: name: sparse_exports
|
||||
+ ; GFX1150: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: EXP 2, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_WAITCNT_EXPCNT $sgpr_null, 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: $vgpr0 = V_AND_B32_e32 1, $vgpr0, implicit $exec
|
||||
+ ; GFX1150-NEXT: EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_WAITCNT_EXPCNT $sgpr_null, 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: $vgpr0 = V_OR_B32_e32 2, $vgpr0, implicit $exec
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ EXP 2, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ $vgpr0 = V_AND_B32_e32 1, $vgpr0, implicit $exec
|
||||
+ EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ $vgpr0 = V_OR_B32_e32 2, $vgpr0, implicit $exec
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: existing_setprio_1
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ ; GFX1150-LABEL: name: existing_setprio_1
|
||||
+ ; GFX1150: bb.0:
|
||||
+ ; GFX1150-NEXT: successors: %bb.1(0x80000000)
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: $vgpr0 = V_AND_B32_e32 1, $vgpr0, implicit $exec
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: bb.1:
|
||||
+ ; GFX1150-NEXT: successors: %bb.2(0x80000000)
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 3
|
||||
+ ; GFX1150-NEXT: $vgpr0 = V_OR_B32_e32 2, $vgpr0, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: bb.2:
|
||||
+ ; GFX1150-NEXT: successors: %bb.3(0x80000000)
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 3
|
||||
+ ; GFX1150-NEXT: $vgpr0 = V_OR_B32_e32 3, $vgpr0, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: bb.3:
|
||||
+ ; GFX1150-NEXT: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ $vgpr0 = V_AND_B32_e32 1, $vgpr0, implicit $exec
|
||||
+
|
||||
+ bb.1:
|
||||
+ liveins: $vgpr0
|
||||
+ S_SETPRIO 3
|
||||
+ $vgpr0 = V_OR_B32_e32 2, $vgpr0, implicit $exec
|
||||
+ S_SETPRIO 0
|
||||
+
|
||||
+ bb.2:
|
||||
+ liveins: $vgpr0
|
||||
+ S_SETPRIO 1
|
||||
+ $vgpr0 = V_OR_B32_e32 3, $vgpr0, implicit $exec
|
||||
+ S_SETPRIO 0
|
||||
+
|
||||
+ bb.3:
|
||||
+ liveins: $vgpr0
|
||||
+ EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
+
|
||||
+---
|
||||
+name: existing_setprio_2
|
||||
+tracksRegLiveness: true
|
||||
+liveins:
|
||||
+ - { reg: '$vgpr0' }
|
||||
+body: |
|
||||
+ bb.0:
|
||||
+ liveins: $vgpr0
|
||||
+ ; GFX1150-LABEL: name: existing_setprio_2
|
||||
+ ; GFX1150: liveins: $vgpr0
|
||||
+ ; GFX1150-NEXT: {{ $}}
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 3
|
||||
+ ; GFX1150-NEXT: EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 0
|
||||
+ ; GFX1150-NEXT: S_WAITCNT_EXPCNT $sgpr_null, 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_NOP 0
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 2
|
||||
+ ; GFX1150-NEXT: S_SETPRIO 3
|
||||
+ ; GFX1150-NEXT: S_ENDPGM 0
|
||||
+ S_SETPRIO 3
|
||||
+ EXP 1, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ EXP_DONE 0, $vgpr0, $vgpr0, $vgpr0, $vgpr0, -1, -1, 15, implicit $exec
|
||||
+ S_SETPRIO 3
|
||||
+ S_ENDPGM 0
|
||||
+...
|
||||
|
||||
From 8ea44e65f2c19facff751aeb2ac960f907fb210f Mon Sep 17 00:00:00 2001
|
||||
From: Carl Ritson <carl.ritson@amd.com>
|
||||
Date: Wed, 17 Jul 2024 16:18:02 +0900
|
||||
Subject: [PATCH 2/3] Remove -verify-machineinstrs from test.
|
||||
|
||||
---
|
||||
llvm/test/CodeGen/AMDGPU/required-export-priority.ll | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/llvm/test/CodeGen/AMDGPU/required-export-priority.ll b/llvm/test/CodeGen/AMDGPU/required-export-priority.ll
|
||||
index 377902f3f0d1a..ebc209bd4d451 100644
|
||||
--- a/llvm/test/CodeGen/AMDGPU/required-export-priority.ll
|
||||
+++ b/llvm/test/CodeGen/AMDGPU/required-export-priority.ll
|
||||
@@ -1,5 +1,5 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
|
||||
-; RUN: llc -mtriple=amdgcn -mcpu=gfx1150 -amdgpu-enable-vopd=0 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
|
||||
+; RUN: llc -mtriple=amdgcn -mcpu=gfx1150 -amdgpu-enable-vopd=0 < %s | FileCheck -check-prefix=GCN %s
|
||||
|
||||
define amdgpu_ps void @test_export_zeroes_f32() #0 {
|
||||
; GCN-LABEL: test_export_zeroes_f32:
|
157
llvm.spec
157
llvm.spec
@ -2,7 +2,7 @@
|
||||
#region version
|
||||
%global maj_ver 19
|
||||
%global min_ver 1
|
||||
%global patch_ver 3
|
||||
%global patch_ver 5
|
||||
#global rc_ver 4
|
||||
|
||||
%bcond_with snapshot_build
|
||||
@ -56,6 +56,7 @@
|
||||
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros
|
||||
%global toolchain clang
|
||||
|
||||
|
||||
%if %{defined rhel} && 0%{?rhel} < 10
|
||||
%global gts_version 14
|
||||
%endif
|
||||
@ -181,7 +182,7 @@
|
||||
#region main package
|
||||
Name: %{pkg_name_llvm}
|
||||
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
|
||||
Release: 4%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Summary: The Low Level Virtual Machine
|
||||
|
||||
License: Apache-2.0 WITH LLVM-exception OR NCSA
|
||||
@ -249,6 +250,10 @@ Patch102: 0003-PATCH-clang-Don-t-install-static-libraries.patch
|
||||
# More info is available here: https://reviews.llvm.org/D159115#4641826
|
||||
Patch103: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch
|
||||
|
||||
# With the introduction of --gcc-include-dir in the clang config file,
|
||||
# this might no longer be needed.
|
||||
Patch104: 0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch
|
||||
|
||||
#region LLD patches
|
||||
Patch1800: 0001-18-Always-build-shared-libs-for-LLD.patch
|
||||
Patch1902: 0001-19-Always-build-shared-libs-for-LLD.patch
|
||||
@ -256,17 +261,20 @@ Patch2000: 0001-19-Always-build-shared-libs-for-LLD.patch
|
||||
#endregion LLD patches
|
||||
|
||||
#region RHEL patches
|
||||
# All RHEL
|
||||
%if %{maj_ver} >= 20
|
||||
Patch500: 0001-20-Remove-myst_parser-dependency-for-RHEL.patch
|
||||
%else
|
||||
Patch500: 0001-19-Remove-myst_parser-dependency-for-RHEL.patch
|
||||
%endif
|
||||
|
||||
# RHEL 8 only
|
||||
Patch501: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch
|
||||
#endregion RHEL patches
|
||||
|
||||
# Backport with modifications from
|
||||
# https://github.com/llvm/llvm-project/pull/99273
|
||||
# Fixes RHEL-49517.
|
||||
Patch1801: 18-99273.patch
|
||||
|
||||
# Fix profiling after a binutils NOTE change.
|
||||
# https://github.com/llvm/llvm-project/pull/114907
|
||||
Patch1802: 0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch
|
||||
Patch1903: 0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch
|
||||
|
||||
%if 0%{?rhel} == 8
|
||||
%global python3_pkgversion 3.12
|
||||
%global __python3 /usr/bin/python3.12
|
||||
@ -283,6 +291,7 @@ BuildRequires: cmake
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: ninja-build
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: libzstd-devel
|
||||
BuildRequires: libffi-devel
|
||||
BuildRequires: ncurses-devel
|
||||
# This intentionally does not use python3_pkgversion. RHEL 8 does not have
|
||||
@ -362,7 +371,7 @@ BuildRequires: procps-ng
|
||||
# For reproducible pyc file generation
|
||||
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility
|
||||
# Since Fedora 41 this happens automatically, and RHEL 8 does not support this.
|
||||
%if (%{defined fedora} && 0%{?fedora} < 41) || 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%if %{without compat_build} && ((%{defined fedora} && 0%{?fedora} < 41) || 0%{?rhel} == 9 || 0%{?rhel} == 10)
|
||||
BuildRequires: /usr/bin/marshalparser
|
||||
%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib}
|
||||
%endif
|
||||
@ -788,13 +797,9 @@ The package contains the LLDB Python module.
|
||||
# automatically apply patches based on LLVM version
|
||||
%autopatch -m%{maj_ver}00 -M%{maj_ver}99 -p1
|
||||
|
||||
%if %{defined rhel}
|
||||
%patch -p1 -P500
|
||||
|
||||
%if %{rhel} == 8
|
||||
%if %{defined rhel} && 0%{?rhel} == 8
|
||||
%patch -p1 -P501
|
||||
%endif
|
||||
%endif
|
||||
|
||||
#region LLVM preparation
|
||||
|
||||
@ -829,10 +834,6 @@ The package contains the LLDB Python module.
|
||||
|
||||
#endregion COMPILER-RT preparation
|
||||
|
||||
#region LLDB preparation
|
||||
# Empty lldb/docs/CMakeLists.txt because we cannot build it
|
||||
echo "" > lldb/docs/CMakeLists.txt
|
||||
#endregion LLDB preparation
|
||||
#endregion prep
|
||||
|
||||
#region build
|
||||
@ -848,6 +849,7 @@ echo "" > lldb/docs/CMakeLists.txt
|
||||
%endif
|
||||
|
||||
%if %reduce_debuginfo == 1
|
||||
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
|
||||
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
|
||||
%endif
|
||||
|
||||
@ -883,7 +885,18 @@ popd
|
||||
%endif
|
||||
|
||||
#region cmake options
|
||||
%global cmake_config_args ""
|
||||
|
||||
# Common cmake arguments used by both the normal build and bundle_compat_lib.
|
||||
# Any ABI-affecting flags should be in here.
|
||||
%global cmake_common_args \\\
|
||||
-DLLVM_ENABLE_EH=ON \\\
|
||||
-DLLVM_ENABLE_RTTI=ON \\\
|
||||
-DLLVM_USE_PERF=ON \\\
|
||||
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \\\
|
||||
-DBUILD_SHARED_LIBS=OFF \\\
|
||||
-DLLVM_BUILD_LLVM_DYLIB=ON
|
||||
|
||||
%global cmake_config_args %{cmake_common_args}
|
||||
|
||||
#region clang options
|
||||
%global cmake_config_args %{cmake_config_args} \\\
|
||||
@ -913,14 +926,20 @@ popd
|
||||
#endregion compiler-rt options
|
||||
|
||||
#region docs options
|
||||
|
||||
# Add all *enabled* documentation targets (no doxygen but sphinx)
|
||||
%global cmake_config_args %{cmake_config_args} \\\
|
||||
-DLLVM_BUILD_DOCS:BOOL=ON \\\
|
||||
-DLLVM_ENABLE_SPHINX:BOOL=ON \\\
|
||||
-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \\\
|
||||
-DSPHINX_WARNINGS_AS_ERRORS=OFF \\\
|
||||
-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\
|
||||
-DLLVM_INCLUDE_DOCS:BOOL=ON \\\
|
||||
-DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html
|
||||
-DLLVM_ENABLE_SPHINX:BOOL=ON \\\
|
||||
-DLLVM_BUILD_DOCS:BOOL=ON
|
||||
|
||||
# Configure sphinx:
|
||||
# Build man-pages but no HTML docs using sphinx
|
||||
%global cmake_config_args %{cmake_config_args} \\\
|
||||
-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \\\
|
||||
-DSPHINX_OUTPUT_HTML:BOOL=OFF \\\
|
||||
-DSPHINX_OUTPUT_MAN:BOOL=ON \\\
|
||||
-DSPHINX_WARNINGS_AS_ERRORS=OFF
|
||||
#endregion docs options
|
||||
|
||||
#region lldb options
|
||||
@ -944,21 +963,19 @@ popd
|
||||
-DLLVM_APPEND_VC_REV:BOOL=OFF \\\
|
||||
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \\\
|
||||
-DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \\\
|
||||
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \\\
|
||||
-DLLVM_BUILD_RUNTIME:BOOL=ON \\\
|
||||
-DLLVM_BUILD_TOOLS:BOOL=ON \\\
|
||||
-DLLVM_BUILD_UTILS:BOOL=ON \\\
|
||||
-DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \\\
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \\\
|
||||
-DLLVM_DYLIB_COMPONENTS="all" \\\
|
||||
-DLLVM_ENABLE_EH=ON \\\
|
||||
-DLLVM_ENABLE_FFI:BOOL=ON \\\
|
||||
-DLLVM_ENABLE_LIBCXX:BOOL=OFF \\\
|
||||
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \\\
|
||||
-DLLVM_ENABLE_PROJECTS="%{projects}" \\\
|
||||
-DLLVM_ENABLE_RTTI:BOOL=ON \\\
|
||||
-DLLVM_ENABLE_RUNTIMES="compiler-rt;openmp;offload" \\\
|
||||
-DLLVM_ENABLE_ZLIB:BOOL=ON \\\
|
||||
-DLLVM_ENABLE_ZLIB:BOOL=FORCE_ON \\\
|
||||
-DLLVM_ENABLE_ZSTD:BOOL=FORCE_ON \\\
|
||||
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \\\
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF \\\
|
||||
-DLLVM_INCLUDE_EXAMPLES:BOOL=ON \\\
|
||||
@ -968,10 +985,8 @@ popd
|
||||
-DLLVM_INSTALL_UTILS:BOOL=ON \\\
|
||||
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \\\
|
||||
-DLLVM_PARALLEL_LINK_JOBS=1 \\\
|
||||
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \\\
|
||||
-DLLVM_TOOLS_INSTALL_DIR:PATH=bin \\\
|
||||
-DLLVM_UNREACHABLE_OPTIMIZE:BOOL=OFF \\\
|
||||
-DLLVM_USE_PERF:BOOL=ON \\\
|
||||
-DLLVM_UTILS_INSTALL_DIR:PATH=bin
|
||||
#endregion llvm options
|
||||
|
||||
@ -999,7 +1014,6 @@ popd
|
||||
|
||||
#region misc options
|
||||
%global cmake_config_args %{cmake_config_args} \\\
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF \\\
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \\\
|
||||
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \\\
|
||||
-DENABLE_LINKER_BUILD_ID:BOOL=ON \\\
|
||||
@ -1074,7 +1088,7 @@ fi
|
||||
|
||||
%cmake_build
|
||||
|
||||
# If we don't build the runtimes target here, we'll have to wait for the %check
|
||||
# If we don't build the runtimes target here, we'll have to wait for the %%check
|
||||
# section until these files are available but they need to be installed.
|
||||
#
|
||||
# /usr/lib64/libomptarget.devicertl.a
|
||||
@ -1091,14 +1105,10 @@ cd ..
|
||||
-DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \
|
||||
-DCMAKE_SKIP_RPATH=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
||||
-DLLVM_ENABLE_EH=ON \
|
||||
-DLLVM_ENABLE_RTTI=ON \
|
||||
-DLLVM_ENABLE_PROJECTS="clang;lldb" \
|
||||
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
%{cmake_common_args}
|
||||
|
||||
%ninja_build -C ../llvm-compat-libs LLVM
|
||||
%ninja_build -C ../llvm-compat-libs libclang.so
|
||||
@ -1177,6 +1187,35 @@ done
|
||||
mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake
|
||||
cp -Rv cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake
|
||||
|
||||
# Install a placeholder to redirect users of the formerly shipped
|
||||
# HTML documentation to the upstream HTML documentation.
|
||||
mkdir -pv %{buildroot}%{_pkgdocdir}/html
|
||||
cat <<EOF > %{buildroot}%{_pkgdocdir}/html/index.html
|
||||
<!doctype html>
|
||||
<html lang=en>
|
||||
<head>
|
||||
<title>LLVM %{maj_ver}.%{min_ver} documentation</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
LLVM %{maj_ver}.%{min_ver} Documentation
|
||||
</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://releases.llvm.org/%{maj_ver}.%{min_ver}.0/docs/index.html">
|
||||
Click here for the upstream documentation of LLVM %{maj_ver}.%{min_ver}.
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://llvm.org/docs/">
|
||||
Click here for the latest upstream documentation of LLVM.
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
#endregion LLVM installation
|
||||
|
||||
#region CLANG installation
|
||||
@ -1254,9 +1293,7 @@ chmod a+x %{buildroot}%{install_datadir}/scan-view/{Reporter.py,startfile.py}
|
||||
rm -vf %{buildroot}%{install_datadir}/clang/clang-format-bbedit.applescript
|
||||
rm -vf %{buildroot}%{install_datadir}/clang/clang-format-sublime.py*
|
||||
|
||||
# TODO: Package html docs
|
||||
rm -Rvf %{buildroot}%{install_docdir}/LLVM/clang/html
|
||||
rm -Rvf %{buildroot}%{install_docdir}/LLVM/clang-tools/html
|
||||
# Remove unpackaged files
|
||||
rm -Rvf %{buildroot}%{install_datadir}/clang-doc/clang-doc-default-stylesheet.css
|
||||
rm -Rvf %{buildroot}%{install_datadir}/clang-doc/index.js
|
||||
|
||||
@ -1275,7 +1312,8 @@ echo "%%clang%{maj_ver}_resource_dir %%{_prefix}/lib/clang/%{maj_ver}" >> %{buil
|
||||
%if %{maj_ver} >=18
|
||||
%global cfg_file_content --gcc-triple=%{_target_cpu}-redhat-linux
|
||||
|
||||
%if %{defined rhel} && 0%{?rhel} < 10
|
||||
# We want to use DWARF-5 on all snapshot builds.
|
||||
%if %{without snapshot_build} && %{defined rhel} && 0%{?rhel} < 10
|
||||
%global cfg_file_content %{cfg_file_content} -gdwarf-4 -g0
|
||||
%endif
|
||||
|
||||
@ -1286,7 +1324,13 @@ echo "%%clang%{maj_ver}_resource_dir %%{_prefix}/lib/clang/%{maj_ver}" >> %{buil
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/
|
||||
echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang.cfg
|
||||
echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang++.cfg
|
||||
%ifarch x86_64
|
||||
# On x86_64, install an additional set of config files so -m32 works.
|
||||
echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang.cfg
|
||||
echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang++.cfg
|
||||
%endif
|
||||
%endif
|
||||
|
||||
|
||||
#endregion CLANG installation
|
||||
|
||||
@ -1338,9 +1382,6 @@ rm %{buildroot}%{install_bindir}/llvm-omp-kernel-replay
|
||||
|
||||
#region LLD installation
|
||||
|
||||
# Remove LLD's HTML documentation files
|
||||
rm -Rvf %{buildroot}%{install_docdir}/LLVM/lld/html
|
||||
|
||||
%if %{without compat_build}
|
||||
# Required when using update-alternatives:
|
||||
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
|
||||
@ -1564,6 +1605,13 @@ test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_one_int.c")
|
||||
test_list_filter_out+=("libomp :: flush/omp_flush.c")
|
||||
%endif
|
||||
|
||||
%ifarch aarch64 s390x
|
||||
# The following test has been failling intermittently on aarch64 and s390x.
|
||||
# Re-enable it after https://github.com/llvm/llvm-project/issues/117773
|
||||
# gets fixed.
|
||||
test_list_filter_out+=("libarcher :: races/taskwait-depend.c")
|
||||
%endif
|
||||
|
||||
# The following tests seem pass on ppc64le and x86_64 and aarch64 only:
|
||||
%ifnarch ppc64le x86_64 s390x aarch64
|
||||
# Passes on ppc64le:
|
||||
@ -2029,14 +2077,14 @@ fi
|
||||
|
||||
%files -n %{pkg_name_llvm}-libs
|
||||
%license llvm/LICENSE.TXT
|
||||
%{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix:%{llvm_snapshot_version_suffix}}.so
|
||||
%{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix}.so
|
||||
%if %{with gold}
|
||||
%{install_libdir}/LLVMgold.so
|
||||
%if %{without compat_build}
|
||||
%{_libdir}/bfd-plugins/LLVMgold.so
|
||||
%endif
|
||||
%endif
|
||||
%{install_libdir}/libLLVM.so.%{maj_ver}.%{min_ver}%{?llvm_snapshot_version_suffix:%{llvm_snapshot_version_suffix}}
|
||||
%{install_libdir}/libLLVM.so.%{maj_ver}.%{min_ver}%{?llvm_snapshot_version_suffix}
|
||||
%{install_libdir}/libLTO.so*
|
||||
%{install_libdir}/libRemarks.so*
|
||||
%if %{with compat_build}
|
||||
@ -2066,7 +2114,7 @@ fi
|
||||
|
||||
%files -n %{pkg_name_llvm}-doc
|
||||
%license llvm/LICENSE.TXT
|
||||
%doc %{_pkgdocdir}/html
|
||||
%doc %{_pkgdocdir}/html/index.html
|
||||
|
||||
%files -n %{pkg_name_llvm}-static
|
||||
%license llvm/LICENSE.TXT
|
||||
@ -2123,6 +2171,10 @@ fi
|
||||
%{install_bindir}/clang-cpp
|
||||
%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang.cfg
|
||||
%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang++.cfg
|
||||
%ifarch x86_64
|
||||
%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang.cfg
|
||||
%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang++.cfg
|
||||
%endif
|
||||
%{_mandir}/man1/clang-%{maj_ver}.1.gz
|
||||
%{_mandir}/man1/clang++-%{maj_ver}.1.gz
|
||||
%if %{without compat_build}
|
||||
@ -2439,6 +2491,8 @@ fi
|
||||
%{install_libdir}/liblldb*.so
|
||||
%{install_libdir}/liblldb.so.*
|
||||
%{install_libdir}/liblldbIntelFeatures.so.*
|
||||
%{_mandir}/man1/lldb-server%{exec_suffix}.1.gz
|
||||
%{_mandir}/man1/lldb%{exec_suffix}.1.gz
|
||||
%if %{with bundle_compat_lib}
|
||||
%{_libdir}/liblldb.so.%{compat_maj_ver}*
|
||||
%endif
|
||||
@ -2454,6 +2508,9 @@ fi
|
||||
|
||||
#region changelog
|
||||
%changelog
|
||||
* Tue Dec 03 2024 Timm Bäder <tbaeder@redhat.com> - 19.1.5-1
|
||||
- Update to 19.1.5
|
||||
|
||||
* Tue Nov 26 2024 Tom Stellard <tstellar@redhat.com> - 19.1.3-4
|
||||
- Add explicit version requires to libomp for llvm-libs
|
||||
|
||||
|
4
sources
4
sources
@ -1,4 +1,4 @@
|
||||
SHA512 (llvm-project-19.1.3.src.tar.xz) = 0abaf158b373892d5afc184158600df17a0797547ad7238ca9018d6fcdd7310b0db803d158daa82a2e04bd42d9daebaa2c3e4b9024c0fa2df72a88596575df5c
|
||||
SHA512 (llvm-project-19.1.3.src.tar.xz.sig) = 84ef22ee78dbaad4710becbcb02119d06063099f9102bb86f3cd44fbb7e2d87bafe239d8e0cbf22ab5a479f99a11a77125f22394d5006ed86262076ccbf1634d
|
||||
SHA512 (llvm-project-19.1.5.src.tar.xz.sig) = a438c86ce882eb1ac3e50842937068794ed162bb1b7ded68a2fe3ec2ab4f57cc38aee667cfb46afe6da22eef7ed1cb65820a473f63bd5a0dc6aad41df7bfad54
|
||||
SHA512 (llvm-project-19.1.5.src.tar.xz) = 648854e9c91fdcc5c677ce3800e046f2060b998a45cf9f7eebe02898431b3924f9348b6fc366102cd4fdda72dcb8f32076f98aa69927e0e20b3f1007fba10b22
|
||||
SHA512 (llvm-project-18.1.8.src.tar.xz) = 25eeee9984c8b4d0fbc240df90f33cbb000d3b0414baff5c8982beafcc5e59e7ef18f6f85d95b3a5f60cb3d4cd4f877c80487b5768bc21bc833f107698ad93db
|
||||
SHA512 (llvm-project-18.1.8.src.tar.xz.sig) = ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b
|
||||
|
Loading…
Reference in New Issue
Block a user