From 20986fa8fcc4c1594b7606b32d9f1936059f4e6c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 21 Apr 2026 17:25:47 +0200 Subject: [PATCH] Update to LLVM 22.1.3 Resolves: RHEL-140428 Related: RHEL-140430 --- ...-funwind-tables-the-default-on-all-a.patch | 27 ++ ...erts-to-test-added-in-145149-because.patch | 26 -- ...Base-Scaled-Reg-does-not-dominate-in.patch | 131 ------- ...ake-sure-instruction-get-from-SunkAd.patch | 143 -------- ...ling-of-undefs-in-the-PPC-isSplatShu.patch | 67 ---- ...-symlink-when-finding-install-prefix.patch | 39 -- 20-131099.patch | 28 -- 21-146424.patch | 94 ----- 22-185375.patch | 86 +++++ 22-185922.patch | 55 +++ 22-190701.patch | 87 +++++ changelog | 3 + gating.yaml | 2 +- llvm.spec | 337 ++++++++++-------- sources | 2 + 15 files changed, 450 insertions(+), 677 deletions(-) create mode 100644 0001-23-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch delete mode 100644 0001-Add-REQUIRES-asserts-to-test-added-in-145149-because.patch delete mode 100644 0001-CGP-Bail-out-if-Base-Scaled-Reg-does-not-dominate-in.patch delete mode 100644 0001-CodeGenPrepare-Make-sure-instruction-get-from-SunkAd.patch delete mode 100644 0001-PowerPC-Fix-handling-of-undefs-in-the-PPC-isSplatShu.patch delete mode 100644 0001-cmake-Resolve-symlink-when-finding-install-prefix.patch delete mode 100644 20-131099.patch delete mode 100644 21-146424.patch create mode 100644 22-185375.patch create mode 100644 22-185922.patch create mode 100644 22-190701.patch diff --git a/0001-23-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch b/0001-23-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch new file mode 100644 index 0000000..c79b55d --- /dev/null +++ b/0001-23-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch @@ -0,0 +1,27 @@ +From 49f827b09db549de62dcaf8b90b3fcb3e08c0ee5 Mon Sep 17 00:00:00 2001 +From: Serge Guelton +Date: Mon, 6 Mar 2023 12:37:48 +0100 +Subject: [PATCH] Make -funwind-tables the default on all archs + +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 24fbdcffc07b..8fed46b49515 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -3082,6 +3082,10 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const { + case llvm::Triple::riscv64be: + case llvm::Triple::x86: + case llvm::Triple::x86_64: ++ // Enable -funwind-tables on all architectures supported by Fedora: ++ // rhbz#1655546 ++ case llvm::Triple::systemz: ++ case llvm::Triple::arm: + return UnwindTableLevel::Asynchronous; + default: + return UnwindTableLevel::None; +-- +2.39.1 + diff --git a/0001-Add-REQUIRES-asserts-to-test-added-in-145149-because.patch b/0001-Add-REQUIRES-asserts-to-test-added-in-145149-because.patch deleted file mode 100644 index 26f372c..0000000 --- a/0001-Add-REQUIRES-asserts-to-test-added-in-145149-because.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ffc7d5ae2d79f98967943fabb2abfbc1b1e047fd Mon Sep 17 00:00:00 2001 -From: Douglas Yung -Date: Tue, 24 Jun 2025 04:08:34 +0000 -Subject: [PATCH] Add `REQUIRES: asserts` to test added in #145149 because it - uses the `-debug-only=` flag. - -This should fix the test failure when building without asserts. ---- - llvm/test/CodeGen/PowerPC/pr141642.ll | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/llvm/test/CodeGen/PowerPC/pr141642.ll b/llvm/test/CodeGen/PowerPC/pr141642.ll -index 38a706574786..61bda4dfaf53 100644 ---- a/llvm/test/CodeGen/PowerPC/pr141642.ll -+++ b/llvm/test/CodeGen/PowerPC/pr141642.ll -@@ -2,6 +2,7 @@ - ; RUN: FileCheck %s - ; CHECK-NOT: lxvdsx - ; CHECK-NOT: LD_SPLAT -+; REQUIRES: asserts - - define weak_odr dso_local void @unpack(ptr noalias noundef %packed_in) local_unnamed_addr { - entry: --- -2.49.0 - diff --git a/0001-CGP-Bail-out-if-Base-Scaled-Reg-does-not-dominate-in.patch b/0001-CGP-Bail-out-if-Base-Scaled-Reg-does-not-dominate-in.patch deleted file mode 100644 index 0c2d067..0000000 --- a/0001-CGP-Bail-out-if-Base-Scaled-Reg-does-not-dominate-in.patch +++ /dev/null @@ -1,131 +0,0 @@ -From dde30a47313bf52fef02bbcb1de931a8d725659f Mon Sep 17 00:00:00 2001 -From: Florian Hahn -Date: Fri, 6 Jun 2025 12:38:30 +0100 -Subject: [PATCH] [CGP] Bail out if (Base|Scaled)Reg does not dominate insert - point. (#142949) - -(Base|Scaled)Reg may not dominate the chosen insert point, if there are -multiple uses of the address. Bail out if that's the case, otherwise we -will generate invalid IR. - -In some cases, we could probably adjust the insert point or hoist the -(Base|Scaled)Reg. - -Fixes https://github.com/llvm/llvm-project/issues/142830. - -PR: https://github.com/llvm/llvm-project/pull/142949 ---- - llvm/lib/CodeGen/CodeGenPrepare.cpp | 13 +++- - .../X86/sink-addrmode-reg-does-not-geps.ll | 76 +++++++++++++++++++ - 2 files changed, 87 insertions(+), 2 deletions(-) - create mode 100644 llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-reg-does-not-geps.ll - -diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp -index 822ed6283117..32348a899683 100644 ---- a/llvm/lib/CodeGen/CodeGenPrepare.cpp -+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp -@@ -5945,8 +5945,17 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr, - // The current BB may be optimized multiple times, we can't guarantee the - // reuse of Addr happens later, call findInsertPos to find an appropriate - // insert position. -- IRBuilder<> Builder(MemoryInst->getParent(), -- findInsertPos(Addr, MemoryInst, SunkAddr)); -+ auto InsertPos = findInsertPos(Addr, MemoryInst, SunkAddr); -+ -+ // TODO: Adjust insert point considering (Base|Scaled)Reg if possible. -+ if (!SunkAddr) { -+ auto &DT = getDT(*MemoryInst->getFunction()); -+ if ((AddrMode.BaseReg && !DT.dominates(AddrMode.BaseReg, &*InsertPos)) || -+ (AddrMode.ScaledReg && !DT.dominates(AddrMode.ScaledReg, &*InsertPos))) -+ return Modified; -+ } -+ -+ IRBuilder<> Builder(MemoryInst->getParent(), InsertPos); - - if (SunkAddr) { - LLVM_DEBUG(dbgs() << "CGP: Reusing nonlocal addrmode: " << AddrMode -diff --git a/llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-reg-does-not-geps.ll b/llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-reg-does-not-geps.ll -new file mode 100644 -index 000000000000..1640bafbd0bf ---- /dev/null -+++ b/llvm/test/Transforms/CodeGenPrepare/X86/sink-addrmode-reg-does-not-geps.ll -@@ -0,0 +1,76 @@ -+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 -+; RUN: opt -S -passes='require,function(codegenprepare)' %s | FileCheck %s -+ -+target triple = "x86_64-unknown-linux" -+ -+declare i1 @cond(float) -+ -+define void @scaled_reg_does_not_dominate_insert_point(ptr %src) { -+; CHECK-LABEL: define void @scaled_reg_does_not_dominate_insert_point( -+; CHECK-SAME: ptr [[SRC:%.*]]) { -+; CHECK-NEXT: [[BB:.*]]: -+; CHECK-NEXT: br label %[[LOOP:.*]] -+; CHECK: [[LOOP]]: -+; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[BB]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ] -+; CHECK-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1 -+; CHECK-NEXT: [[SUNKADDR2:%.*]] = mul i64 [[IV_NEXT]], 2 -+; CHECK-NEXT: [[SUNKADDR3:%.*]] = getelementptr i8, ptr [[SRC]], i64 [[SUNKADDR2]] -+; CHECK-NEXT: [[SUNKADDR4:%.*]] = getelementptr i8, ptr [[SUNKADDR3]], i64 6 -+; CHECK-NEXT: [[L_0:%.*]] = load float, ptr [[SUNKADDR4]], align 4 -+; CHECK-NEXT: [[SUNKADDR:%.*]] = mul i64 [[IV]], 2 -+; CHECK-NEXT: [[SUNKADDR1:%.*]] = getelementptr i8, ptr [[SRC]], i64 [[SUNKADDR]] -+; CHECK-NEXT: [[L_1:%.*]] = load float, ptr [[SUNKADDR1]], align 4 -+; CHECK-NEXT: [[TMP0:%.*]] = call i1 @cond(float [[L_0]]) -+; CHECK-NEXT: [[C:%.*]] = call i1 @cond(float [[L_1]]) -+; CHECK-NEXT: br i1 [[C]], label %[[LOOP]], label %[[EXIT:.*]] -+; CHECK: [[EXIT]]: -+; CHECK-NEXT: ret void -+; -+bb: -+ %gep.base = getelementptr i8, ptr %src, i64 8 -+ br label %loop -+ -+loop: -+ %iv = phi i64 [ 0, %bb ], [ %iv.next, %loop ] -+ %iv.shl = shl i64 %iv, 1 -+ %gep.shl = getelementptr i8, ptr %gep.base, i64 %iv.shl -+ %gep.sub = getelementptr i8, ptr %gep.shl, i64 -8 -+ %iv.next = add i64 %iv, 1 -+ %l.0 = load float, ptr %gep.shl, align 4 -+ %l.1 = load float, ptr %gep.sub, align 4 -+ call i1 @cond(float %l.0) -+ %c = call i1 @cond(float %l.1) -+ br i1 %c, label %loop, label %exit -+ -+exit: -+ ret void -+} -+ -+define void @check_dt_after_modifying_cfg(ptr %dst, i64 %x, i8 %y, i8 %z) { -+; CHECK-LABEL: define void @check_dt_after_modifying_cfg( -+; CHECK-SAME: ptr [[DST:%.*]], i64 [[X:%.*]], i8 [[Y:%.*]], i8 [[Z:%.*]]) { -+; CHECK-NEXT: [[ENTRY:.*]]: -+; CHECK-NEXT: [[OFFSET:%.*]] = lshr i64 [[X]], 2 -+; CHECK-NEXT: [[SEL_FROZEN:%.*]] = freeze i8 [[Z]] -+; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[SEL_FROZEN]], 0 -+; CHECK-NEXT: br i1 [[CMP]], label %[[SELECT_END:.*]], label %[[SELECT_FALSE_SINK:.*]] -+; CHECK: [[SELECT_FALSE_SINK]]: -+; CHECK-NEXT: [[SMIN:%.*]] = tail call i8 @llvm.smin.i8(i8 [[Y]], i8 0) -+; CHECK-NEXT: br label %[[SELECT_END]] -+; CHECK: [[SELECT_END]]: -+; CHECK-NEXT: [[SEL:%.*]] = phi i8 [ 0, %[[ENTRY]] ], [ [[SMIN]], %[[SELECT_FALSE_SINK]] ] -+; CHECK-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr [[DST]], i64 [[OFFSET]] -+; CHECK-NEXT: store i8 [[SEL]], ptr [[SUNKADDR]], align 1 -+; CHECK-NEXT: ret void -+; -+entry: -+ %offset = lshr i64 %x, 2 -+ %gep.dst = getelementptr i8, ptr %dst, i64 %offset -+ %smin = tail call i8 @llvm.smin.i8(i8 %y, i8 0) -+ %cmp = icmp slt i8 %z, 0 -+ %sel = select i1 %cmp, i8 0, i8 %smin -+ store i8 %sel, ptr %gep.dst, align 1 -+ ret void -+} -+ -+declare i8 @llvm.smin.i8(i8, i8) #0 --- -2.50.1 - diff --git a/0001-CodeGenPrepare-Make-sure-instruction-get-from-SunkAd.patch b/0001-CodeGenPrepare-Make-sure-instruction-get-from-SunkAd.patch deleted file mode 100644 index a195bc5..0000000 --- a/0001-CodeGenPrepare-Make-sure-instruction-get-from-SunkAd.patch +++ /dev/null @@ -1,143 +0,0 @@ -From c76137f1cfd5758f6889236d49a65f059e6432ff Mon Sep 17 00:00:00 2001 -From: weiguozhi <57237827+weiguozhi@users.noreply.github.com> -Date: Thu, 15 May 2025 09:27:25 -0700 -Subject: [PATCH] [CodeGenPrepare] Make sure instruction get from SunkAddrs is - before MemoryInst (#139303) - -Function optimizeBlock may do optimizations on a block for multiple -times. In the first iteration of the loop, MemoryInst1 may generate a -sunk instruction and store it into SunkAddrs. In the second iteration of -the loop, MemoryInst2 may use the same address and then it can reuse the -sunk instruction stored in SunkAddrs, but MemoryInst2 may be before -MemoryInst1 and the corresponding sunk instruction. In order to avoid -use before def error, we need to find appropriate insert position for the - sunk instruction. - -Fixes #138208. - -(cherry picked from commit 59c6d70ed8120b8864e5f796e2bf3de5518a0ef0) ---- - llvm/lib/CodeGen/CodeGenPrepare.cpp | 41 ++++++++++++++--- - .../CodeGenPrepare/X86/sink-addr-reuse.ll | 44 +++++++++++++++++++ - 2 files changed, 80 insertions(+), 5 deletions(-) - create mode 100644 llvm/test/Transforms/CodeGenPrepare/X86/sink-addr-reuse.ll - -diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp -index 088062afab17..f779f4b782ae 100644 ---- a/llvm/lib/CodeGen/CodeGenPrepare.cpp -+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp -@@ -5728,6 +5728,35 @@ static bool IsNonLocalValue(Value *V, BasicBlock *BB) { - return false; - } - -+// Find an insert position of Addr for MemoryInst. We can't guarantee MemoryInst -+// is the first instruction that will use Addr. So we need to find the first -+// user of Addr in current BB. -+static BasicBlock::iterator findInsertPos(Value *Addr, Instruction *MemoryInst, -+ Value *SunkAddr) { -+ if (Addr->hasOneUse()) -+ return MemoryInst->getIterator(); -+ -+ // We already have a SunkAddr in current BB, but we may need to insert cast -+ // instruction after it. -+ if (SunkAddr) { -+ if (Instruction *AddrInst = dyn_cast(SunkAddr)) -+ return std::next(AddrInst->getIterator()); -+ } -+ -+ // Find the first user of Addr in current BB. -+ Instruction *Earliest = MemoryInst; -+ for (User *U : Addr->users()) { -+ Instruction *UserInst = dyn_cast(U); -+ if (UserInst && UserInst->getParent() == MemoryInst->getParent()) { -+ if (isa(UserInst) || UserInst->isDebugOrPseudoInst()) -+ continue; -+ if (UserInst->comesBefore(Earliest)) -+ Earliest = UserInst; -+ } -+ } -+ return Earliest->getIterator(); -+} -+ - /// Sink addressing mode computation immediate before MemoryInst if doing so - /// can be done without increasing register pressure. The need for the - /// register pressure constraint means this can end up being an all or nothing -@@ -5852,11 +5881,6 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr, - return Modified; - } - -- // Insert this computation right after this user. Since our caller is -- // scanning from the top of the BB to the bottom, reuse of the expr are -- // guaranteed to happen later. -- IRBuilder<> Builder(MemoryInst); -- - // Now that we determined the addressing expression we want to use and know - // that we have to sink it into this block. Check to see if we have already - // done this for some other load/store instr in this block. If so, reuse -@@ -5867,6 +5891,13 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr, - - Value *SunkAddr = SunkAddrVH.pointsToAliveValue() ? SunkAddrVH : nullptr; - Type *IntPtrTy = DL->getIntPtrType(Addr->getType()); -+ -+ // The current BB may be optimized multiple times, we can't guarantee the -+ // reuse of Addr happens later, call findInsertPos to find an appropriate -+ // insert position. -+ IRBuilder<> Builder(MemoryInst->getParent(), -+ findInsertPos(Addr, MemoryInst, SunkAddr)); -+ - if (SunkAddr) { - LLVM_DEBUG(dbgs() << "CGP: Reusing nonlocal addrmode: " << AddrMode - << " for " << *MemoryInst << "\n"); -diff --git a/llvm/test/Transforms/CodeGenPrepare/X86/sink-addr-reuse.ll b/llvm/test/Transforms/CodeGenPrepare/X86/sink-addr-reuse.ll -new file mode 100644 -index 000000000000..019f31140655 ---- /dev/null -+++ b/llvm/test/Transforms/CodeGenPrepare/X86/sink-addr-reuse.ll -@@ -0,0 +1,44 @@ -+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 -+; RUN: opt -S -p 'require,codegenprepare' -cgpp-huge-func=0 < %s | FileCheck %s -+ -+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" -+target triple = "x86_64-grtev4-linux-gnu" -+ -+declare void @g(ptr) -+ -+; %load and %load5 use the same address, %load5 is optimized first, %load is -+; optimized later and reuse the same address computation instruction. We must -+; make sure not to generate use before def error. -+ -+define void @f(ptr %arg) { -+; CHECK-LABEL: define void @f( -+; CHECK-SAME: ptr [[ARG:%.*]]) { -+; CHECK-NEXT: [[BB:.*:]] -+; CHECK-NEXT: [[GETELEMENTPTR:%.*]] = getelementptr i8, ptr [[ARG]], i64 -64 -+; CHECK-NEXT: call void @g(ptr [[GETELEMENTPTR]]) -+; CHECK-NEXT: [[SUNKADDR1:%.*]] = getelementptr i8, ptr [[ARG]], i64 -64 -+; CHECK-NEXT: [[LOAD:%.*]] = load ptr, ptr [[SUNKADDR1]], align 8 -+; CHECK-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr [[ARG]], i64 -56 -+; CHECK-NEXT: [[LOAD4:%.*]] = load i32, ptr [[SUNKADDR]], align 8 -+; CHECK-NEXT: [[LOAD5:%.*]] = load ptr, ptr [[SUNKADDR1]], align 8 -+; CHECK-NEXT: [[TMP0:%.*]] = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 1, i32 0) -+; CHECK-NEXT: [[MATH:%.*]] = extractvalue { i32, i1 } [[TMP0]], 0 -+; CHECK-NEXT: ret void -+; -+bb: -+ %getelementptr = getelementptr i8, ptr %arg, i64 -64 -+ %getelementptr1 = getelementptr i8, ptr %arg, i64 -56 -+ call void @g(ptr %getelementptr) -+ br label %bb3 -+ -+bb3: -+ %load = load ptr, ptr %getelementptr, align 8 -+ %load4 = load i32, ptr %getelementptr1, align 8 -+ %load5 = load ptr, ptr %getelementptr, align 8 -+ %add = add i32 1, 0 -+ %icmp = icmp eq i32 %add, 0 -+ br i1 %icmp, label %bb7, label %bb7 -+ -+bb7: -+ ret void -+} --- -2.49.0 - diff --git a/0001-PowerPC-Fix-handling-of-undefs-in-the-PPC-isSplatShu.patch b/0001-PowerPC-Fix-handling-of-undefs-in-the-PPC-isSplatShu.patch deleted file mode 100644 index e3d6135..0000000 --- a/0001-PowerPC-Fix-handling-of-undefs-in-the-PPC-isSplatShu.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 735d721de451067c3a618b309703d0b8beb9cacc Mon Sep 17 00:00:00 2001 -From: Wael Yehia -Date: Mon, 23 Jun 2025 13:22:33 -0400 -Subject: [PATCH] [PowerPC] Fix handling of undefs in the - PPC::isSplatShuffleMask query (#145149) - -Currently, the query assumes that a single undef byte implies the rest of -the `EltSize - 1` bytes are undefs, but that's not always true. -e.g. isSplatShuffleMask( -<0,1,2,3,4,5,6,7,undef,undef,undef,undef,0,1,2,3>, 8) should return -false. - ---------- - -Co-authored-by: Wael Yehia ---- - llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 13 +++++++++---- - llvm/test/CodeGen/PowerPC/pr141642.ll | 13 +++++++++++++ - 2 files changed, 22 insertions(+), 4 deletions(-) - create mode 100644 llvm/test/CodeGen/PowerPC/pr141642.ll - -diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp -index 421a808de667..88c6fe632d26 100644 ---- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp -+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp -@@ -2242,10 +2242,15 @@ bool PPC::isSplatShuffleMask(ShuffleVectorSDNode *N, unsigned EltSize) { - return false; - - for (unsigned i = EltSize, e = 16; i != e; i += EltSize) { -- if (N->getMaskElt(i) < 0) continue; -- for (unsigned j = 0; j != EltSize; ++j) -- if (N->getMaskElt(i+j) != N->getMaskElt(j)) -- return false; -+ // An UNDEF element is a sequence of UNDEF bytes. -+ if (N->getMaskElt(i) < 0) { -+ for (unsigned j = 1; j != EltSize; ++j) -+ if (N->getMaskElt(i + j) >= 0) -+ return false; -+ } else -+ for (unsigned j = 0; j != EltSize; ++j) -+ if (N->getMaskElt(i + j) != N->getMaskElt(j)) -+ return false; - } - return true; - } -diff --git a/llvm/test/CodeGen/PowerPC/pr141642.ll b/llvm/test/CodeGen/PowerPC/pr141642.ll -new file mode 100644 -index 000000000000..38a706574786 ---- /dev/null -+++ b/llvm/test/CodeGen/PowerPC/pr141642.ll -@@ -0,0 +1,13 @@ -+; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu -O0 -debug-only=selectiondag -o - < %s 2>&1 | \ -+; RUN: FileCheck %s -+; CHECK-NOT: lxvdsx -+; CHECK-NOT: LD_SPLAT -+ -+define weak_odr dso_local void @unpack(ptr noalias noundef %packed_in) local_unnamed_addr { -+entry: -+ %ld = load <2 x i32>, ptr %packed_in, align 2 -+ %shuf = shufflevector <2 x i32> %ld, <2 x i32> poison, <4 x i32> -+ %ie = insertelement <4 x i32> %shuf, i32 7, i32 2 -+ store <4 x i32> %shuf, ptr %packed_in, align 2 -+ ret void -+} --- -2.49.0 - diff --git a/0001-cmake-Resolve-symlink-when-finding-install-prefix.patch b/0001-cmake-Resolve-symlink-when-finding-install-prefix.patch deleted file mode 100644 index 2b62da0..0000000 --- a/0001-cmake-Resolve-symlink-when-finding-install-prefix.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 06774eb8a7dc0bc36b59e53310c7f5b5d89f6c29 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Tue, 28 Jan 2025 12:31:49 +0100 -Subject: [PATCH] [cmake] Resolve symlink when finding install prefix - -When determining the install prefix in LLVMConfig.cmake etc resolve -symlinks in CMAKE_CURRENT_LIST_FILE first. The motivation for this -is to support symlinks like `/usr/lib64/cmake/llvm` to -`/usr/lib64/llvm19/lib/cmake/llvm`. This only works correctly if -the paths are relative to the resolved symlink. - -It's worth noting that this *mostly* already works out of the box, -because cmake automatically does the symlink resolution when the -library is found via CMAKE_PREFIX_PATH. It just doesn't happen -when it's found via the default prefix path. ---- - cmake/Modules/FindPrefixFromConfig.cmake | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/cmake/Modules/FindPrefixFromConfig.cmake b/cmake/Modules/FindPrefixFromConfig.cmake -index 22211e4b72f2..3daff607ff84 100644 ---- a/cmake/Modules/FindPrefixFromConfig.cmake -+++ b/cmake/Modules/FindPrefixFromConfig.cmake -@@ -39,10 +39,10 @@ function(find_prefix_from_config out_var prefix_var path_to_leave) - # install prefix, and avoid hard-coding any absolute paths. - set(config_code - "# Compute the installation prefix from this LLVMConfig.cmake file location." -- "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)") -+ "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)") - # Construct the proper number of get_filename_component(... PATH) - # calls to compute the installation prefix. -- string(REGEX REPLACE "/" ";" _count "${path_to_leave}") -+ string(REGEX REPLACE "/" ";" _count "${path_to_leave}/plus_one") - foreach(p ${_count}) - list(APPEND config_code - "get_filename_component(${prefix_var} \"\${${prefix_var}}\" PATH)") --- -2.48.1 - diff --git a/20-131099.patch b/20-131099.patch deleted file mode 100644 index 0b66256..0000000 --- a/20-131099.patch +++ /dev/null @@ -1,28 +0,0 @@ -From e43271ec7438ecb78f99db134aeca274a47f6c28 Mon Sep 17 00:00:00 2001 -From: Konrad Kleine -Date: Thu, 13 Mar 2025 09:12:24 +0100 -Subject: [PATCH] Filter out configuration file from compile commands - -The commands to run the compilation when printed with `-###` contain -various irrelevant lines for the perf-training. Most of them are -filtered out already but when configured with -`CLANG_CONFIG_FILE_SYSTEM_DIR` a new line like the following is -added and needs to be filtered out: - -`Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg` ---- - clang/utils/perf-training/perf-helper.py | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/clang/utils/perf-training/perf-helper.py b/clang/utils/perf-training/perf-helper.py -index 80c6356d0497c..29904aded5ab0 100644 ---- a/clang/utils/perf-training/perf-helper.py -+++ b/clang/utils/perf-training/perf-helper.py -@@ -237,6 +237,7 @@ def get_cc1_command_for_args(cmd, env): - or ln.startswith("InstalledDir:") - or ln.startswith("LLVM Profile Note") - or ln.startswith(" (in-process)") -+ or ln.startswith("Configuration file:") - or " version " in ln - ): - continue diff --git a/21-146424.patch b/21-146424.patch deleted file mode 100644 index 5b95886..0000000 --- a/21-146424.patch +++ /dev/null @@ -1,94 +0,0 @@ -From eba58195932f37fb461ae17c69fc517181b99c9a Mon Sep 17 00:00:00 2001 -From: Paul Murphy -Date: Mon, 30 Jun 2025 10:13:37 -0500 -Subject: [PATCH] [PowerPC] fix lowering of SPILL_CRBIT on pwr9 and pwr10 - -If a copy exists between creation of a crbit and a spill, machine-cp -may delete the copy since it seems unaware of the relation between a cr -and crbit. A fix was previously made for the generic ppc64 lowering. It -should be applied to the pwr9 and pwr10 variants too. - -Likewise, relax and extend the pwr8 test to verify pwr9 and pwr10 -codegen too. - -This fixes #143989. ---- - llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp | 17 +++++++++++------ - .../PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir | 8 +++++++- - 2 files changed, 18 insertions(+), 7 deletions(-) - -diff --git a/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp b/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp -index 76dca4794e05..78d254a55fd9 100644 ---- a/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp -+++ b/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp -@@ -1102,13 +1102,20 @@ void PPCRegisterInfo::lowerCRBitSpilling(MachineBasicBlock::iterator II, - SpillsKnownBit = true; - break; - default: -+ // When spilling a CR bit, The super register may not be explicitly defined -+ // (i.e. it can be defined by a CR-logical that only defines the subreg) so -+ // we state that the CR field is undef. Also, in order to preserve the kill -+ // flag on the CR bit, we add it as an implicit use. -+ - // On Power10, we can use SETNBC to spill all CR bits. SETNBC will set all - // bits (specifically, it produces a -1 if the CR bit is set). Ultimately, - // the bit that is of importance to us is bit 32 (bit 0 of a 32-bit - // register), and SETNBC will set this. - if (Subtarget.isISA3_1()) { - BuildMI(MBB, II, dl, TII.get(LP64 ? PPC::SETNBC8 : PPC::SETNBC), Reg) -- .addReg(SrcReg, RegState::Undef); -+ .addReg(SrcReg, RegState::Undef) -+ .addReg(SrcReg, RegState::Implicit | -+ getKillRegState(MI.getOperand(0).isKill())); - break; - } - -@@ -1122,16 +1129,14 @@ void PPCRegisterInfo::lowerCRBitSpilling(MachineBasicBlock::iterator II, - SrcReg == PPC::CR4LT || SrcReg == PPC::CR5LT || - SrcReg == PPC::CR6LT || SrcReg == PPC::CR7LT) { - BuildMI(MBB, II, dl, TII.get(LP64 ? PPC::SETB8 : PPC::SETB), Reg) -- .addReg(getCRFromCRBit(SrcReg), RegState::Undef); -+ .addReg(getCRFromCRBit(SrcReg), RegState::Undef) -+ .addReg(SrcReg, RegState::Implicit | -+ getKillRegState(MI.getOperand(0).isKill())); - break; - } - } - - // We need to move the CR field that contains the CR bit we are spilling. -- // The super register may not be explicitly defined (i.e. it can be defined -- // by a CR-logical that only defines the subreg) so we state that the CR -- // field is undef. Also, in order to preserve the kill flag on the CR bit, -- // we add it as an implicit use. - BuildMI(MBB, II, dl, TII.get(LP64 ? PPC::MFOCRF8 : PPC::MFOCRF), Reg) - .addReg(getCRFromCRBit(SrcReg), RegState::Undef) - .addReg(SrcReg, -diff --git a/llvm/test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir b/llvm/test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir -index 41e21248a3f0..2796cdb3ae87 100644 ---- a/llvm/test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir -+++ b/llvm/test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir -@@ -1,6 +1,12 @@ - # RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu -start-after \ - # RUN: virtregrewriter -ppc-asm-full-reg-names -verify-machineinstrs %s \ - # RUN: -o - | FileCheck %s -+# RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu -start-after \ -+# RUN: virtregrewriter -ppc-asm-full-reg-names -verify-machineinstrs %s \ -+# RUN: -o - | FileCheck %s -+# RUN: llc -mcpu=pwr10 -mtriple=powerpc64le-unknown-linux-gnu -start-after \ -+# RUN: virtregrewriter -ppc-asm-full-reg-names -verify-machineinstrs %s \ -+# RUN: -o - | FileCheck %s - - --- | - ; ModuleID = 'a.ll' -@@ -30,7 +36,7 @@ - ; Function Attrs: nounwind - declare void @llvm.stackprotector(ptr, ptr) #1 - -- attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64le" "target-features"="+altivec,+bpermd,+crypto,+direct-move,+extdiv,+htm,+power8-vector,+vsx,-power9-vector" "unsafe-fp-math"="false" "use-soft-float"="false" } -+ attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } - attributes #1 = { nounwind } - - !llvm.ident = !{!0} --- -2.49.0 - diff --git a/22-185375.patch b/22-185375.patch new file mode 100644 index 0000000..82c3af9 --- /dev/null +++ b/22-185375.patch @@ -0,0 +1,86 @@ +From f463bef09be73ae9a415fcd3fd49689bd95b0f0a Mon Sep 17 00:00:00 2001 +From: Congcong Cai +Date: Fri, 20 Feb 2026 07:03:27 +0800 +Subject: [PATCH] [SimplifyCFG] process prof data when remove case in umin + (#182261) + +In #164097, we introduce a optimization for umin. But it does not handle +profile data correctly. +This PR remove profile data when remove cases. +Fixed: #181837 + +(cherry picked from commit 31e5f86a3cdc960ef7b2f0a533c4a37cf526cacd) +--- + llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 2 +- + .../Transforms/SimplifyCFG/switch-umin.ll | 43 +++++++++++++++++++ + 2 files changed, 44 insertions(+), 1 deletion(-) + +diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +index 5f4807242581d..a16f274a4ed5a 100644 +--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp ++++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +@@ -7724,7 +7724,7 @@ static bool simplifySwitchWhenUMin(SwitchInst *SI, DomTreeUpdater *DTU) { + BasicBlock *DeadCaseBB = I->getCaseSuccessor(); + DeadCaseBB->removePredecessor(BB); + Updates.push_back({DominatorTree::Delete, BB, DeadCaseBB}); +- I = SIW->removeCase(I); ++ I = SIW.removeCase(I); + E = SIW->case_end(); + } + +diff --git a/llvm/test/Transforms/SimplifyCFG/switch-umin.ll b/llvm/test/Transforms/SimplifyCFG/switch-umin.ll +index 44665365dc222..ff958e4d04147 100644 +--- a/llvm/test/Transforms/SimplifyCFG/switch-umin.ll ++++ b/llvm/test/Transforms/SimplifyCFG/switch-umin.ll +@@ -239,8 +239,51 @@ case4: + + } + ++define void @switch_remove_dead_cases(i32 %x) { ++; CHECK-LABEL: define void @switch_remove_dead_cases( ++; CHECK-SAME: i32 [[X:%.*]]) { ++; CHECK-NEXT: [[MIN:%.*]] = call i32 @llvm.umin.i32(i32 [[X]], i32 4) ++; CHECK-NEXT: switch i32 [[X]], label %[[COMMON_RET:.*]] [ ++; CHECK-NEXT: i32 2, label %[[CASE_A:.*]] ++; CHECK-NEXT: i32 3, label %[[CASE_B:.*]] ++; CHECK-NEXT: ], !prof [[PROF1:![0-9]+]] ++; CHECK: [[COMMON_RET]]: ++; CHECK-NEXT: ret void ++; CHECK: [[CASE_A]]: ++; CHECK-NEXT: call void @a() ++; CHECK-NEXT: br label %[[COMMON_RET]] ++; CHECK: [[CASE_B]]: ++; CHECK-NEXT: call void @b() ++; CHECK-NEXT: br label %[[COMMON_RET]] ++; ++ %min = call i32 @llvm.umin.i32(i32 %x, i32 4) ++ switch i32 %min, label %unreachable [ ++ i32 2, label %case_a ++ i32 3, label %case_b ++ i32 4, label %case_ret ++ i32 5, label %case_ret ++ ], !prof !1 ++ ++case_a: ++ call void @a() ++ ret void ++ ++case_b: ++ call void @b() ++ ret void ++ ++case_ret: ++ ret void ++ ++unreachable: ++ unreachable ++} + + !0 = !{!"branch_weights", i32 1, i32 2, i32 3, i32 99, i32 5} + ;. + ; CHECK: [[PROF0]] = !{!"branch_weights", i32 5, i32 2, i32 3, i32 99} + ;. ++!1 = !{!"branch_weights", i32 11, i32 12, i32 13, i32 14, i32 15} ++;. ++; CHECK: [[PROF1]] = !{!"branch_weights", i32 14, i32 12, i32 13} ++;. diff --git a/22-185922.patch b/22-185922.patch new file mode 100644 index 0000000..4513df1 --- /dev/null +++ b/22-185922.patch @@ -0,0 +1,55 @@ +From ccf0ee68b86f65a6a4e83756f717faad7c779cb1 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 11 Mar 2026 18:03:05 +0100 +Subject: [PATCH] [SystemZ] Limit depth of findCCUse() + +The recursion here has potentially exponential complexity. Avoid +this by limiting the depth of recursion. + +An alternative would be to memoize the results. I went with the +simpler depth limit on the assumption that we don't particularly +care about very deep value chains here. +--- + llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +index 2a9cb903f3921..84d66f88a812d 100644 +--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp ++++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +@@ -8692,7 +8692,12 @@ SDValue SystemZTargetLowering::combineSETCC( + return SDValue(); + } + +-static std::pair findCCUse(const SDValue &Val) { ++static std::pair findCCUse(const SDValue &Val, ++ unsigned Depth = 0) { ++ // Limit depth of potentially exponential walk. ++ if (Depth > 5) ++ return std::make_pair(SDValue(), SystemZ::CCMASK_NONE); ++ + switch (Val.getOpcode()) { + default: + return std::make_pair(SDValue(), SystemZ::CCMASK_NONE); +@@ -8705,7 +8710,7 @@ static std::pair findCCUse(const SDValue &Val) { + SDValue Op4CCReg = Val.getOperand(4); + if (Op4CCReg.getOpcode() == SystemZISD::ICMP || + Op4CCReg.getOpcode() == SystemZISD::TM) { +- auto [OpCC, OpCCValid] = findCCUse(Op4CCReg.getOperand(0)); ++ auto [OpCC, OpCCValid] = findCCUse(Op4CCReg.getOperand(0), Depth + 1); + if (OpCC != SDValue()) + return std::make_pair(OpCC, OpCCValid); + } +@@ -8722,10 +8727,10 @@ static std::pair findCCUse(const SDValue &Val) { + case ISD::SHL: + case ISD::SRA: + case ISD::SRL: +- auto [Op0CC, Op0CCValid] = findCCUse(Val.getOperand(0)); ++ auto [Op0CC, Op0CCValid] = findCCUse(Val.getOperand(0), Depth + 1); + if (Op0CC != SDValue()) + return std::make_pair(Op0CC, Op0CCValid); +- return findCCUse(Val.getOperand(1)); ++ return findCCUse(Val.getOperand(1), Depth + 1); + } + } + diff --git a/22-190701.patch b/22-190701.patch new file mode 100644 index 0000000..51c3246 --- /dev/null +++ b/22-190701.patch @@ -0,0 +1,87 @@ +From 3915d1efcdb1e9d10c8f6966acbe5c359d824ba1 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 6 Apr 2026 14:08:10 -0700 +Subject: [PATCH] [CodeGen] Preserve big-endian trunc in concat_vectors + +A transform from `concat_vectors(trunc(scalar), undef)` to +`scalar_to_vector(scalar)` is only equivalent for little-endian targets. +On big-endian, that would put the extra upper bytes ahead of the desired +truncated bytes. This problem was seen on Rust s390x in [RHEL-147748]. + +[RHEL-147748]: https://redhat.atlassian.net/browse/RHEL-147748 + +Assisted-by: Claude Code +--- + llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 +- + llvm/test/CodeGen/SystemZ/vec-trunc-to-i16.ll | 45 +++++++++++++++++++ + 2 files changed, 48 insertions(+), 1 deletion(-) + create mode 100644 llvm/test/CodeGen/SystemZ/vec-trunc-to-i16.ll + +diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +index 383e45c5ea3a8..5485ee86251a5 100644 +--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ++++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +@@ -26513,9 +26513,11 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) { + // If the bitcast type isn't legal, it might be a trunc of a legal type; + // look through the trunc so we can still do the transform: + // concat_vectors(trunc(scalar), undef) -> scalar_to_vector(scalar) ++ // However, this is only equivalent on little-endian targets. + if (Scalar->getOpcode() == ISD::TRUNCATE && + !TLI.isTypeLegal(Scalar.getValueType()) && +- TLI.isTypeLegal(Scalar->getOperand(0).getValueType())) ++ TLI.isTypeLegal(Scalar->getOperand(0).getValueType()) && ++ DAG.getDataLayout().isLittleEndian()) + Scalar = Scalar->getOperand(0); + + EVT SclTy = Scalar.getValueType(); +diff --git a/llvm/test/CodeGen/SystemZ/vec-trunc-to-i16.ll b/llvm/test/CodeGen/SystemZ/vec-trunc-to-i16.ll +new file mode 100644 +index 0000000000000..42d787d945145 +--- /dev/null ++++ b/llvm/test/CodeGen/SystemZ/vec-trunc-to-i16.ll +@@ -0,0 +1,45 @@ ++; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ++; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s ++ ++; Test that truncated scalars use the correct vector insert instruction. ++; On big-endian targets, concat_vectors should not skip truncates when ++; creating scalar_to_vector, as the bytes would be in the wrong position. ++ ++; This truncated i16 should use vlvgh (insert halfword), not vlvgf (insert fullword). ++define <16 x i8> @test_concat_trunc_i16(i32 %x) { ++; CHECK-LABEL: test_concat_trunc_i16: ++; CHECK: # %bb.0: ++; CHECK-NEXT: vlvgh %v24, %r2, 0 ++; CHECK-NEXT: br %r14 ++ %t = trunc i32 %x to i16 ++ %vec = bitcast i16 %t to <2 x i8> ++ %result = shufflevector <2 x i8> %vec, <2 x i8> poison, <16 x i32> ++ ret <16 x i8> %result ++} ++ ++; Test with a more complex shuffle pattern, reduced from a Rust bug report. ++define fastcc void @test_shuffle_with_trunc() { ++; CHECK-LABEL: test_shuffle_with_trunc: ++; CHECK: # %bb.0: ++; CHECK-NEXT: lh %r1, 0 ++; CHECK-NEXT: l %r0, 0 ++; CHECK-NEXT: vlvgh %v1, %r1, 0 ++; CHECK-NEXT: larl %r1, .LCPI1_0 ++; CHECK-NEXT: vl %v2, 0(%r1), 3 ++; CHECK-NEXT: vlvgf %v0, %r0, 0 ++; CHECK-NEXT: vperm %v0, %v0, %v1, %v2 ++; CHECK-NEXT: vst %v0, 0, 3 ++; CHECK-NEXT: br %r14 ++ %1 = load i32, ptr null, align 8 ++ %2 = load i16, ptr null, align 1 ++ br label %3 ++ ++3: ++ %4 = bitcast i32 %1 to <4 x i8> ++ %5 = shufflevector <4 x i8> %4, <4 x i8> zeroinitializer, <16 x i32> ++ %6 = bitcast i16 %2 to <2 x i8> ++ %7 = shufflevector <2 x i8> %6, <2 x i8> zeroinitializer, <16 x i32> ++ %8 = shufflevector <16 x i8> %5, <16 x i8> %7, <16 x i32> ++ store <16 x i8> %8, ptr null, align 8 ++ ret void ++} diff --git a/changelog b/changelog index 6a50205..8d60930 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +* Wed Apr 22 2026 Nikita Popov - 22.1.3-1 +- Update to LLVM 22.1.3 + * Mon Jul 28 2025 Paul Murphy - 20.1.8-3 - Backport fix for pgo optimized rust toolchain on ppc64le (rhbz#2382683) - Backport fix for crbit spill miscompile on ppc64le power9 and power10 (rhbz#2383037) diff --git a/gating.yaml b/gating.yaml index f0c9afb..97dd90b 100644 --- a/gating.yaml +++ b/gating.yaml @@ -13,7 +13,7 @@ rules: --- !Policy product_versions: # The version number here should match the current rawhide release. - - fedora-44 + - fedora-45 decision_contexts: - bodhi_update_push_stable - bodhi_update_push_stable_critpath diff --git a/llvm.spec b/llvm.spec index 1d4e491..6cd9957 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,8 +1,8 @@ #region globals #region version -%global maj_ver 21 +%global maj_ver 22 %global min_ver 1 -%global patch_ver 8 +%global patch_ver 3 #global rc_ver rc3 %bcond_with snapshot_build @@ -28,6 +28,7 @@ %define bcond_override_default_offload 0 %define bcond_override_default_mlir 0 %define bcond_override_default_flang 0 +%define bcond_override_default_libclc 0 %define bcond_override_default_build_bolt 0 %define bcond_override_default_polly 0 %define bcond_override_default_pgo 0 @@ -41,11 +42,11 @@ %bcond_with compat_build # Bundle compat libraries for a previous LLVM version, as part of llvm-libs and # clang-libs. Used on RHEL. -%bcond_with bundle_compat_lib +%bcond_without bundle_compat_lib %bcond_without check %if %{with bundle_compat_lib} -%global compat_maj_ver 20 +%global compat_maj_ver 21 %global compat_ver %{compat_maj_ver}.1.8 %endif @@ -77,7 +78,7 @@ # MLIR version 22 started to require nanobind >= 2.9, which is only available # on Fedora >= 44. -%if %{without compat_build} && %{defined fedora} && (%{maj_ver} < 22 || 0%{?fedora} >= 44) +%if %{without compat_build} && %{defined fedora} && 0%{?fedora} >= 44 %ifarch %{ix86} %bcond_with mlir %else @@ -88,7 +89,7 @@ %endif #region flang -%if %{without compat_build} && %{defined fedora} && (%{maj_ver} >= 22 && 0%{?fedora} >= 44) +%if %{without compat_build} && %{defined fedora} && 0%{?fedora} >= 44 # Link error on i686. # s390x is not supported upstream yet. %ifarch i686 s390x @@ -109,6 +110,8 @@ # Set Fortran build flags to nil because they contain flags that don't apply to flang. %global build_fflags %{nil} +%endif +#endregion flang %{lua: @@ -145,8 +148,7 @@ function print_max_procs(per_proc_mem) print(cpu) end } -%endif -#endregion flang + # The libcxx build condition also enables libcxxabi and libunwind. %if %{without compat_build} && %{defined fedora} @@ -224,6 +226,12 @@ end %global _lto_cflags %nil %endif +%if %{maj_ver} >= 23 && 0%{undefined rhel} && %{without compat_build} && %{with snapshot_build} +%bcond_without libclc +%else +%bcond_with libclc +%endif + # We are building with clang for faster/lower memory LTO builds. # See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros # Reminder: This only works on Fedora and RHEL >= 9. @@ -318,6 +326,12 @@ end %global build_install_prefix %{buildroot}%{install_prefix} +%if %{with compat_build} +%global install_pythondir %{install_prefix}/lib/python%{python3_version}/site-packages +%else +%global install_pythondir %{python3_sitelib}/ +%endif + # Lower memory usage of dwz on s390x %global _dwz_low_mem_die_limit_s390x 1 %global _dwz_max_die_limit_s390x 1000000 @@ -399,6 +413,12 @@ end %global pkg_name_flang flang%{pkg_suffix} #endregion flang globals +#region libclc globals +%if %{with libclc} +%global pkg_name_libclc libclc%{pkg_suffix} +%endif +#endregion libclc globals + #endregion globals #region packages @@ -467,9 +487,10 @@ Source1001: changelog # behind the latest packaged LLVM version. #region CLANG patches -Patch101: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch +Patch2100: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch +Patch2200: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch +Patch2300: 0001-23-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch Patch102: 0003-PATCH-clang-Don-t-install-static-libraries.patch -Patch2002: 20-131099.patch # Workaround a bug in ORC on ppc64le. # More info is available here: https://reviews.llvm.org/D159115#4641826 @@ -480,10 +501,6 @@ Patch103: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch Patch104: 0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch #endregion CLANG patches -# Fix LLVMConfig.cmake when symlinks are used. -# (https://github.com/llvm/llvm-project/pull/124743 landed in LLVM 21) -Patch2003: 0001-cmake-Resolve-symlink-when-finding-install-prefix.patch - #region LLD patches Patch106: 0001-19-Always-build-shared-libs-for-LLD.patch Patch2103: 0001-lld-Adjust-compressed-debug-level-test-for-s390x-wit.patch @@ -507,20 +524,6 @@ Patch503: 0002-BPF-Remove-unused-weak-symbol-__bpf_trap-166003.patch Patch504: 0003-BPF-Remove-dead-code-related-to-__bpf_trap-global-va.patch #endregion RHEL patches -# Fix a pgo miscompilation triggered by building Rust 1.87 with pgo on ppc64le. -# https://github.com/llvm/llvm-project/issues/138208 -Patch2004: 0001-CodeGenPrepare-Make-sure-instruction-get-from-SunkAd.patch -# Related CGP fix for domination, rhbz#2388223 -Patch2008: 0001-CGP-Bail-out-if-Base-Scaled-Reg-does-not-dominate-in.patch - -# Fix Power9/Power10 crbit spilling -# https://github.com/llvm/llvm-project/pull/146424 -Patch2007: 21-146424.patch - -# Fix for highway package build on ppc64le -Patch2005: 0001-PowerPC-Fix-handling-of-undefs-in-the-PPC-isSplatShu.patch -Patch2006: 0001-Add-REQUIRES-asserts-to-test-added-in-145149-because.patch - # Fix for offload builds: The DeviceRTL libraries target device code and # don't support the mtls-dialect flag, so we need to patch the clang driver # to ignore it for these targets. @@ -536,6 +539,9 @@ Patch2105: 43cb4631c1f42dbfce78288b8ae30b5840ed59b3.patch # Fix for s390x vector miscompilation (rhbz#2430017) Patch2106: 0001-SystemZ-Fix-code-in-widening-vector-multiplication-1.patch +# Fix for s390x vector miscompilation (RHEL-147748) +Patch2203: 22-190701.patch + %if 0%{?rhel} == 8 %global python3_pkgversion 3.12 %global __python3 /usr/bin/python3.12 @@ -625,20 +631,17 @@ BuildRequires: gnupg2 BuildRequires: swig BuildRequires: libxml2-devel -BuildRequires: doxygen # For clang-offload-packager BuildRequires: elfutils-libelf-devel -BuildRequires: perl -BuildRequires: perl-Data-Dumper -BuildRequires: perl-Encode BuildRequires: libffi-devel +# For scan-build +BuildRequires: perl-interpreter BuildRequires: perl-generators -# According to https://fedoraproject.org/wiki/Packaging:Emacs a package -# should BuildRequires: emacs if it packages emacs integration files. -BuildRequires: emacs +# We only need the emacs packaging macros, which are part of emacs-common. +BuildRequires: emacs-common BuildRequires: libatomic @@ -663,8 +666,6 @@ BuildRequires: python%{python3_pkgversion}-pyyaml BuildRequires: python%{python3_pkgversion}-nanobind-devel %endif -BuildRequires: graphviz - # This is required because we need "ps" when running LLDB tests BuildRequires: procps-ng @@ -930,21 +931,20 @@ Requires: python%{python3_pkgversion} %description -n git-clang-format%{pkg_suffix} clang-format integration for git. -%if %{without compat_build} -%package -n python%{python3_pkgversion}-clang +%package -n python%{python3_pkgversion}-%{pkg_name_clang} Summary: Python3 bindings for clang Requires: %{pkg_name_clang}-devel%{?_isa} = %{version}-%{release} -Requires: python%{python3_pkgversion} +%if "%{?python3_version}" != "" +Requires: python(abi) = %{python3_version} +%endif +Provides: python%{python3_pkgversion}-clang(major) = %{maj_ver} %if 0%{?rhel} == 8 # Became python3.12-clang in LLVM 19 Obsoletes: python3-clang < 18.9 %endif -%description -n python%{python3_pkgversion}-clang +%description -n python%{python3_pkgversion}-%{pkg_name_clang} Python3 bindings for clang. - -%endif - #endregion CLANG packages #region COMPILER-RT packages @@ -1286,6 +1286,50 @@ Flang runtime libraries. %endif #endregion flang packages +#region libclc packages +%if %{with libclc} +%package -n %{pkg_name_libclc} +Summary: An open source implementation of the OpenCL 1.1 library requirements + +License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT +URL: https://libclc.llvm.org +Obsoletes: %{pkg_name_libclc}-devel < 23 + +%description -n %{pkg_name_libclc} +libclc is an open source, BSD licensed implementation of the library +requirements of the OpenCL C programming language, as specified by the +OpenCL 1.1 Specification. The following sections of the specification +impose library requirements: + + * 6.1: Supported Data Types + * 6.2.3: Explicit Conversions + * 6.2.4.2: Reinterpreting Types Using as_type() and as_typen() + * 6.9: Preprocessor Directives and Macros + * 6.11: Built-in Functionsj + * 9.3: Double Precision Floating-Point + * 9.4: 64-bit Atomics + * 9.5: Writing to 3D image memory objects + * 9.6: Half Precision Floating-Point + +libclc is intended to be used with the Clang compiler's OpenCL frontend. + +libclc is designed to be portable and extensible. To this end, it provides +generic implementations of most library requirements, allowing the target +to override the generic implementation at the granularity of individual +functions. + +libclc currently only supports the PTX target, but support for more +targets is welcome. + +%package -n %{pkg_name_libclc}-spirv +Summary: Spirv subset of %{name} + +%description -n %{pkg_name_libclc}-spirv +The %{pkg_name_libclc}-spirv package contains the spirv*-mesa3d-.spv files only, +which are the subset required for upstream Mesa OpenCL support with RustiCL. + +%endif +#endregion libclc packages #endregion packages #region prep @@ -1306,6 +1350,13 @@ Flang runtime libraries. # automatically apply patches based on LLVM version %autopatch -m%{compat_maj_ver}00 -M%{compat_maj_ver}99 -p1 +%if 0%{?rhel} == 8 && %{compat_maj_ver} < 22 +# The following patches have been backported from LLVM 22. +%patch -p1 -P502 +%patch -p1 -P503 +%patch -p1 -P504 +%endif + %endif # -T : Do Not Perform Default Archive Unpacking (without this, the th source would be unpacked twice) @@ -1324,20 +1375,12 @@ Flang runtime libraries. %if %{defined rhel} && 0%{?rhel} == 8 %patch -p1 -P501 -%if %{maj_ver} < 22 -# The following patches have been backported from LLVM 22. -%patch -p1 -P502 -%patch -p1 -P503 -%patch -p1 -P504 -%endif %endif #region LLVM preparation %py3_shebang_fix \ - llvm/test/BugPoint/compile-custom.ll.py \ - llvm/tools/opt-viewer/*.py \ - llvm/utils/update_cc_test_checks.py + llvm/tools/opt-viewer/*.py #endregion LLVM preparation @@ -1440,6 +1483,10 @@ cd llvm/utils/lit %global runtimes %{runtimes};offload %endif +%if %{with libclc} +%global runtimes %{runtimes};libclc +%endif + %global gcc_triple --gcc-triple=%{_target_cpu}-redhat-linux %global cfg_file_content %{gcc_triple} @@ -1511,15 +1558,8 @@ popd -DLLVM_BUILD_LLVM_DYLIB=ON \\\ -DLLVM_LINK_LLVM_DYLIB=ON \\\ -DCLANG_LINK_CLANG_DYLIB=ON \\\ - -DLLVM_ENABLE_FFI:BOOL=ON - -%if %{maj_ver} >= 22 -%global cmake_common_args %{cmake_common_args} \\\ + -DLLVM_ENABLE_FFI:BOOL=ON \\\ -DLLVM_ENABLE_EH=OFF -%else -%global cmake_common_args %{cmake_common_args} \\\ - -DLLVM_ENABLE_EH=ON -%endif %if 0%{?rhel} == 8 # On RHEL 8 we build with gcc, but the runtimes are built with the just built @@ -1690,7 +1730,7 @@ CLANG_LDFLAGS=$(strip_specs "$LDFLAGS $CLANG_LDFLAGS_EXTRA") -DOPENMP_INSTALL_LIBDIR=%{unprefixed_libdir} \\\ -DLIBOMP_INSTALL_ALIASES=OFF -%if %{maj_ver} >= 22 && %{with offload} +%if %{with offload} # We reset the cxxflags to "" here because this is compiling for a GPU # target, where our cflags are either questionable or actively wrong. %global cmake_config_args %{cmake_config_args} \\\ @@ -1735,6 +1775,13 @@ CLANG_LDFLAGS=$(strip_specs "$LDFLAGS $CLANG_LDFLAGS_EXTRA") %endif #endregion flang options +#region libclc options +%if %{with libclc} +# Build SPIR-V targets with the SPIR-V backend. +%global cmake_config_args %{cmake_config_args} \\\ + -DLIBCLC_USE_SPIRV_BACKEND:BOOL=ON +%endif +#endregion libclc options #region test options %global cmake_config_args %{cmake_config_args} \\\ @@ -1858,12 +1905,14 @@ fi -DLLVM_VP_COUNTERS_PER_SITE=8 %if %{defined host_clang_maj_ver} -%global cmake_config_args_instrumented %{cmake_config_args_instrumented} \\\ - -DLLVM_PROFDATA=%{_bindir}/llvm-profdata-%{host_clang_maj_ver} +%global profdata %{_bindir}/llvm-profdata-%{host_clang_maj_ver} +%global cxxfilt %{_bindir}/llvm-cxxfilt-%{host_clang_maj_ver} %else -%global cmake_config_args_instrumented %{cmake_config_args_instrumented} \\\ - -DLLVM_PROFDATA=%{_bindir}/llvm-profdata +%global profdata %{_bindir}/llvm-profdata +%global cxxfilt %{_bindir}/llvm-cxxfilt %endif +%global cmake_config_args_instrumented %{cmake_config_args_instrumented} \\\ + -DLLVM_PROFDATA=%{profdata} # TODO(kkleine): Should we see warnings like: # "function control flow change detected (hash mismatch)" @@ -1882,7 +1931,7 @@ fi %cmake_build --target generate-profdata # Show top 10 functions in the profile -llvm-profdata show --topn=10 %{builddir_instrumented}/tools/clang/utils/perf-training/clang.profdata | llvm-cxxfilt +%{profdata} show --topn=10 %{builddir_instrumented}/tools/clang/utils/perf-training/clang.profdata | %{cxxfilt} cp %{builddir_instrumented}/tools/clang/utils/perf-training/clang.profdata $RPM_BUILD_DIR/result.profdata @@ -2133,15 +2182,6 @@ sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \ -e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \ %{buildroot}%{_rpmmacrodir}/macros.%{pkg_name_clang} -# install clang python bindings -mkdir -p %{buildroot}%{python3_sitelib}/clang/ -# If we don't default to true here, we'll see this error: -# install: omitting directory 'bindings/python/clang/__pycache__' -# NOTE: this only happens if we include the gdb plugin of libomp. -# Remove the plugin with command and we're good: rm -rf %{buildroot}/%{_datarootdir}/gdb -install -p -m644 clang/bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/ -%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang - # install scanbuild-py to python sitelib. mv %{buildroot}%{install_prefix}/lib/{libear,libscanbuild} %{buildroot}%{python3_sitelib} # Cannot use {libear,libscanbuild} style expansion in py_byte_compile. @@ -2165,6 +2205,15 @@ rm -Rf %{buildroot}%{install_datadir}/clang/*.el %endif +# install clang python bindings +mkdir -p %{buildroot}%{install_pythondir}/clang/ +# If we don't default to true here, we'll see this error: +# install: omitting directory 'bindings/python/clang/__pycache__' +# NOTE: this only happens if we include the gdb plugin of libomp. +# Remove the plugin with command and we're good: rm -rf %{buildroot}/%{_datarootdir}/gdb +install -p -m644 clang/bindings/python/clang/* %{buildroot}%{install_pythondir}/clang/ +%py_byte_compile %{__python3} %{buildroot}%{install_pythondir}/clang/ + # Create manpage symlink for clang++ ln -s clang-%{maj_ver}.1 %{buildroot}%{install_mandir}/man1/clang++.1 @@ -2178,9 +2227,6 @@ 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* -# Remove unpackaged files -rm -Rvf %{buildroot}%{install_datadir}/clang-doc - # TODO: What are the Fedora guidelines for packaging bash autocomplete files? rm -vf %{buildroot}%{install_datadir}/clang/bash-autocomplete.sh @@ -2326,13 +2372,11 @@ rm -v %{buildroot}%{install_libdir}/libFIRAnalysis.a \ %{buildroot}%{install_libdir}/libHLFIRTransforms.a \ %{buildroot}%{install_libdir}/libCUFAttrs.a \ %{buildroot}%{install_libdir}/libCUFDialect.a \ - %{buildroot}%{install_libdir}/libFortranDecimal.a -%if %{maj_ver} >= 22 -rm -v %{buildroot}%{install_libdir}/libFortranUtils.a \ + %{buildroot}%{install_libdir}/libFortranDecimal.a \ + %{buildroot}%{install_libdir}/libFortranUtils.a \ %{buildroot}%{install_libdir}/libFIROpenACCAnalysis.a \ %{buildroot}%{install_libdir}/libFIROpenACCTransforms.a \ %{buildroot}%{install_libdir}/libMIFDialect.a -%endif find %{buildroot}%{install_includedir}/flang -type f -a ! -iname '*.mod' -delete @@ -2500,6 +2544,7 @@ function reset_test_opts() # Set to mark tests as expected to fail. # See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-xfail unset LIT_XFAIL + unset LIT_XFAIL_NOT # Set to mark tests to not even run. # See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-filter-out @@ -2517,6 +2562,9 @@ function reset_test_opts() # Some test (e.g. mlir) require this to be set. unset PYTHONPATH + + # We use them in some cases. + unset LIT_NUM_SHARDS LIT_RUN_SHARD } # Convert array of test names into a regex. @@ -2570,6 +2618,7 @@ reset_test_opts reset_test_opts # Xfail testing of update utility tools export LIT_XFAIL="tools/UpdateTestChecks" + %cmake_build --target check-llvm #endregion Test LLVM @@ -2837,6 +2886,7 @@ test_list_filter_out+=("MLIR :: python/execution_engine.py") # if ! LD_SHOW_AUXV=1 /bin/true | grep -q arch_3_00; then test_list_filter_out+=("MLIR :: python/execution_engine.py") test_list_filter_out+=("MLIR :: python/multithreaded_tests.py") +test_list_filter_out+=("MLIR :: python/global_constructors.py") %endif %if %{with flang} @@ -3045,7 +3095,6 @@ fi %license llvm/LICENSE.TXT %{expand_bins %{expand: - bugpoint dsymutil FileCheck llc @@ -3056,6 +3105,7 @@ fi llvm-bcanalyzer llvm-bitcode-strip llvm-c-test + llvm-cas llvm-cat llvm-cfi-verify llvm-cgdata @@ -3079,6 +3129,7 @@ fi llvm-gsymutil llvm-ifs llvm-install-name-tool + llvm-ir2vec llvm-jitlink llvm-jitlink-executor llvm-lib @@ -3096,6 +3147,8 @@ fi llvm-nm llvm-objcopy llvm-objdump + llvm-offload-wrapper + llvm-offload-binary llvm-opt-report llvm-otool llvm-pdbutil @@ -3133,16 +3186,18 @@ fi yaml2obj }} -%if %{maj_ver} >= 22 +%if %{maj_ver} >= 23 %{expand_bins %{expand: - llvm-ir2vec - llvm-offload-wrapper - llvm-offload-binary + llubi + llvm-gpu-loader +}} +%else +%{expand_bins %{expand: + bugpoint }} %endif %{expand_mans %{expand: - bugpoint clang-tblgen dsymutil FileCheck @@ -3167,6 +3222,7 @@ fi llvm-extract llvm-ifs llvm-install-name-tool + llvm-ir2vec llvm-lib llvm-libtool-darwin llvm-link @@ -3177,6 +3233,7 @@ fi llvm-nm llvm-objcopy llvm-objdump + llvm-offload-binary llvm-opt-report llvm-otool llvm-pdbutil @@ -3199,10 +3256,13 @@ fi tblgen }} -%if %{maj_ver} >= 22 +%if %{maj_ver} >= 23 %{expand_mans %{expand: - llvm-ir2vec - llvm-offload-binary + llubi +}} +%else +%{expand_mans %{expand: + bugpoint }} %endif @@ -3275,11 +3335,6 @@ fi llvm-opt-fuzzer llvm-test-mustache-spec }} -%if %{maj_ver} >= 22 -%{expand_bins %{expand: - llvm-cas -}} -%endif %{expand_mans %{expand: llvm-test-mustache-spec }} @@ -3431,6 +3486,13 @@ fi offload-arch }} +%if %{maj_ver} >= 23 +%{expand_bins %{expand: + clang-ssaf-format + clang-ssaf-linker +}} +%endif + %if %{without compat_build} %{_emacs_sitestartdir}/clang-format.el %{_emacs_sitestartdir}/clang-include-fixer.el @@ -3442,6 +3504,7 @@ fi clang/clang-include-fixer.py* clang/clang-tidy-diff.py* clang/run-find-all-symbols.py* + clang-doc/* }} %files -n %{pkg_name_clang}-tools-extra-devel @@ -3452,12 +3515,9 @@ fi %license clang/LICENSE.TXT %expand_bins git-clang-format -%if %{without compat_build} -%files -n python%{python3_pkgversion}-clang +%files -n python%{python3_pkgversion}-%{pkg_name_clang} %license clang/LICENSE.TXT -%{python3_sitelib}/clang/ -%endif - +%{install_pythondir}/clang/ #endregion CLANG files #region COMPILER-RT files @@ -3480,14 +3540,9 @@ fi %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtbegin.o %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtend.o -%ifnarch %{ix86} s390x riscv64 +%ifnarch %{ix86} riscv64 %{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/liborc_rt.a %endif -%ifarch s390x -%if %{maj_ver} >= 22 -%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/liborc_rt.a -%endif -%endif # Additional symlink if two triples are in use. %if "%{llvm_triple}" != "%{compiler_rt_triple}" @@ -3591,13 +3646,9 @@ fi lldb-argdumper lldb-dap lldb-instr + lldb-mcp lldb-server }} -%if %{maj_ver} >= 22 -%{expand_bins %{expand: - lldb-mcp -}} -%endif # Usually, *.so symlinks are kept in devel subpackages. However, the python # bindings depend on this symlink at runtime. %{expand_libs %{expand: @@ -3612,12 +3663,10 @@ fi %files -n %{pkg_name_lldb}-devel %expand_includes lldb -%if %{maj_ver} >= 22 %{expand_bins %{expand: lldb-tblgen yaml2macho-core }} -%endif %if %{without compat_build} %files -n python%{python3_pkgversion}-lldb @@ -3632,6 +3681,7 @@ fi %files -n %{pkg_name_mlir} %license LICENSE.TXT %{expand_libs %{expand: + libmlir_apfloat_wrappers.so.%{maj_ver}* libmlir_arm_runner_utils.so.%{maj_ver}* libmlir_arm_sme_abi_stubs.so.%{maj_ver}* libmlir_async_runtime.so.%{maj_ver}* @@ -3641,12 +3691,6 @@ fi libMLIR*.so.%{maj_ver}* }} -%if %{maj_ver} >= 22 -%{expand_libs %{expand: - libmlir_apfloat_wrappers.so.%{maj_ver}* -}} -%endif - %files -n %{pkg_name_mlir}-static %expand_libs libMLIR*.a @@ -3669,6 +3713,7 @@ fi %expand_includes mlir mlir-c %{expand_libs %{expand: cmake/mlir + libmlir_apfloat_wrappers.so libmlir_arm_runner_utils.so libmlir_arm_sme_abi_stubs.so libmlir_async_runtime.so @@ -3678,19 +3723,11 @@ fi libMLIR*.so }} -%if %{maj_ver} >= 22 -%{expand_libs %{expand: - libmlir_apfloat_wrappers.so -}} -%endif - %files -n python%{python3_pkgversion}-%{pkg_name_mlir} %{python3_sitearch}/mlir/ %endif #endregion MLIR files -#region libcxx files - #region flang files %if %{with flang} %files -n %{pkg_name_flang} @@ -3706,26 +3743,9 @@ fi }} %{install_bindir}/flang-%{maj_ver} %{expand_includes %{expand: - flang/__cuda_builtins.mod - flang/__cuda_device.mod - flang/__fortran_builtins.mod - flang/__fortran_ieee_exceptions.mod - flang/__fortran_type_info.mod - flang/__ppc_intrinsics.mod - flang/__ppc_types.mod - flang/cooperative_groups.mod - flang/ieee_arithmetic.mod - flang/ieee_exceptions.mod - flang/ieee_features.mod - flang/iso_c_binding.mod - flang/iso_fortran_env.mod - flang/mma.mod - flang/cudadevice.mod - flang/iso_fortran_env_impl.mod - flang/omp_lib.mod - flang/omp_lib_kinds.mod - flang/flang_debug.mod + flang/*.mod }} + %{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-flang.cfg %ifarch x86_64 %{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-flang.cfg @@ -3741,6 +3761,27 @@ fi %endif #region flang files +#region libclc files +%if %{with libclc} +%files -n %{pkg_name_libclc} +%license libclc/LICENSE.TXT +%doc libclc/README.md libclc/CREDITS.TXT +%{_prefix}/lib/clang/%{maj_ver}/lib/amdgcn-amd-amdhsa-llvm/libclc.bc +%{_prefix}/lib/clang/%{maj_ver}/lib/nvptx64--/libclc.bc +%{_prefix}/lib/clang/%{maj_ver}/lib/nvptx64--nvidiacl/libclc.bc +%{_prefix}/lib/clang/%{maj_ver}/lib/nvptx64-nvidia-cuda/libclc.bc +%{_prefix}/lib/clang/%{maj_ver}/lib/spir--/libclc.bc +%{_prefix}/lib/clang/%{maj_ver}/lib/spir64--/libclc.bc + +%files -n %{pkg_name_libclc}-spirv +%license libclc/LICENSE.TXT +%doc libclc/README.md libclc/CREDITS.TXT +%{_prefix}/lib/clang/%{maj_ver}/lib/spirv32--/libclc.spv +%{_prefix}/lib/clang/%{maj_ver}/lib/spirv64--/libclc.spv +%endif +#endregion libclc files + +#region libcxx files %if %{with libcxx} %files -n %{pkg_name_libcxx} diff --git a/sources b/sources index 9ed6b4f..191f498 100644 --- a/sources +++ b/sources @@ -1,2 +1,4 @@ +SHA512 (llvm-project-22.1.3.src.tar.xz) = 3557a955d55471671ae2f7b9c809affd59a29a6fb1e70a2a5d040dc1c6376246deb0635be8ca36cae09112981760e9afb128c822e5554bd722589fb8dee3f0df +SHA512 (llvm-project-22.1.3.src.tar.xz.sig) = 153a0d174492a0facd061b5cfa3e18dbf946cc0c7d1fb50f4d961410d41cea1f355515fd3e892be676b8b34d61a21962c48acb90aa5d310d05cf6452053e52ad SHA512 (llvm-project-21.1.8.src.tar.xz) = cae4c44e7bf678071723da63ad5839491d717a7233e7f4791aa408207f3ea42f52de939ad15189b112c02a0770f1bb8d59bae6ad31ef53417a6eea7770fe52ab SHA512 (llvm-project-21.1.8.src.tar.xz.sig) = 10f58eff58ed6e701d0f123b15e68c82ab8cbdf99b1c86c0d83e3b8553e90ea51055e30327e8e442ded57c8f503e2a2de9ee075e9c28b5ba815a0f8922f8671c