Skip to content

Commit 6355601

Browse files
committed
Switch to LLVM versions 20/21 as supported versions.
LLVM 21.1.0 has been released, so by our policy of supporting the two most recent LLVM releases, we can now move from LLVM 19/20 to LLVM 20/21.
1 parent e499661 commit 6355601

File tree

16 files changed

+21
-199
lines changed

16 files changed

+21
-199
lines changed

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm/dibuilder.h

Lines changed: 0 additions & 101 deletions
This file was deleted.

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm/instructions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ struct BinOpHelper;
3636
#define LLVM 20
3737
#include <multi_llvm/instructions.inc>
3838
#undef LLVM
39-
#define LLVM 19
40-
#include <multi_llvm/instructions.inc>
41-
#undef LLVM
4239

4340
} // namespace detail
4441

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm/instructions.inc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@
1414
//
1515
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
1616

17-
#if LLVM == 19
18-
template <typename T>
19-
struct BinOpHelper<T, std::enable_if_t<T::LAST_BINOP - T::FIRST_BINOP == 16>>
20-
#define BINOP_LLVM20(OP, STR)
21-
#define BINOP_LLVM21(OP, STR)
22-
#elif LLVM == 20
17+
#if LLVM == 20
2318
template <typename T>
2419
struct BinOpHelper<T, std::enable_if_t<T::LAST_BINOP - T::FIRST_BINOP == 18>>
25-
#define BINOP_LLVM20(OP, STR) BINOP(OP, STR)
2620
#define BINOP_LLVM21(OP, STR)
2721
#elif LLVM == 21
2822
template <typename T, typename>
2923
struct BinOpHelper
30-
#define BINOP_LLVM20(OP, STR) BINOP(OP, STR)
3124
#define BINOP_LLVM21(OP, STR) BINOP(OP, STR)
3225
#endif
3326
{
@@ -51,8 +44,8 @@ struct BinOpHelper
5144
BINOP_LLVM21(FMinimum, "fminumum") \
5245
BINOP(UIncWrap, "uincwrap") \
5346
BINOP(UDecWrap, "udecwrap") \
54-
BINOP_LLVM20(USubCond, "usubcond") \
55-
BINOP_LLVM20(USubSat, "usubsat")
47+
BINOP(USubCond, "usubcond") \
48+
BINOP(USubSat, "usubsat")
5649

5750
static std::optional<T> consume_front_with_underscore(
5851
llvm::StringRef &String) {
@@ -79,6 +72,5 @@ struct BinOpHelper
7972
}
8073

8174
#undef BINOPS
82-
#undef BINOP_LLVM20
8375
#undef BINOP_LLVM21
8476
};

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm/intrinsic.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,7 @@
2222

2323
namespace multi_llvm {
2424

25-
static inline auto GetOrInsertIntrinsicDeclaration(
26-
llvm::Module *M, llvm::Intrinsic::ID id,
27-
llvm::ArrayRef<llvm::Type *> Tys = {}) {
28-
#if LLVM_VERSION_GREATER_EQUAL(20, 0)
29-
return llvm::Intrinsic::getOrInsertDeclaration(M, id, Tys);
30-
#else
31-
return llvm::Intrinsic::getDeclaration(M, id, Tys);
32-
#endif
33-
}
34-
35-
// Drop getAttributes workaround when LLVM 20 is minimum version
36-
// This can also be simplified once DPC++ catches up with getAttributes
37-
// with FunctionType as the last argument.
25+
// Drop getAttributes workaround when LLVM 21 is minimum version
3826
namespace detail {
3927
template <typename... T>
4028
auto getAttributes(T... args)

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm/loop_utils.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/include/multi_llvm/multi_llvm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@
1818
#define MULTI_LLVM_MULTI_LLVM_H_INCLUDED
1919

2020
#include <multi_llvm/llvm_version.h>
21-
#include <multi_llvm/loop_utils.h>
2221

2322
#endif // MULTI_LLVM_MULTI_LLVM_H_INCLUDED

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/source/builtin_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ Function *BuiltinInfo::getScalarEquivalent(const Builtin &B, Module *M) {
545545
Type *ScalarType = VecRetTy->getElementType();
546546
// Get the scalar version of the intrinsic
547547
Function *ScalarIntrinsic =
548-
multi_llvm::GetOrInsertIntrinsicDeclaration(M, IntrinsicID, ScalarType);
548+
Intrinsic::getOrInsertDeclaration(M, IntrinsicID, ScalarType);
549549

550550
return ScalarIntrinsic;
551551
}

llvm/lib/SYCLNativeCPUUtils/compiler_passes/compiler_pipeline/source/optimal_builtin_replacement_pass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <llvm/IR/Intrinsics.h>
2929
#include <llvm/IR/Module.h>
3030
#include <llvm/TargetParser/Triple.h>
31-
#include <multi_llvm/intrinsic.h>
3231
#include <multi_llvm/vector_type_helper.h>
3332

3433
#define DEBUG_TYPE "ca-optimal-builtins"
@@ -63,7 +62,7 @@ Value *OptimalBuiltinReplacementPass::replaceAbacusCLZ(
6362
// Get the declaration for the intrinsic
6463
auto *const ArgTy = Args[0]->getType();
6564
auto *const Intrinsic =
66-
multi_llvm::GetOrInsertIntrinsicDeclaration(M, Intrinsic::ctlz, ArgTy);
65+
llvm::Intrinsic::getOrInsertDeclaration(M, Intrinsic::ctlz, ArgTy);
6766
// If we didn't find the intrinsic or the return type isn't what we
6867
// expect, skip this optimization
6968
Function *Callee = CB.getCalledFunction();

llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/source/transform/packetization_helpers.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <llvm/IR/Instructions.h>
3131
#include <llvm/IR/Intrinsics.h>
3232
#include <llvm/Transforms/Utils/LoopUtils.h>
33-
#include <multi_llvm/intrinsic.h>
3433
#include <multi_llvm/vector_type_helper.h>
3534

3635
#include "debugging.h"
@@ -241,7 +240,7 @@ Value *createMaybeVPReduction(IRBuilderBase &B, Value *Val, RecurKind Kind,
241240
assert(isa<VectorType>(Val->getType()) && "Must be vector type");
242241
// If VL is null, it's not a vector-predicated reduction.
243242
if (!VL) {
244-
return multi_llvm::createSimpleReduction(B, Val, Kind);
243+
return createSimpleReduction(B, Val, Kind);
245244
}
246245
auto IntrinsicOp = Intrinsic::not_intrinsic;
247246
switch (Kind) {
@@ -290,7 +289,7 @@ Value *createMaybeVPReduction(IRBuilderBase &B, Value *Val, RecurKind Kind,
290289
break;
291290
}
292291

293-
auto *const F = multi_llvm::GetOrInsertIntrinsicDeclaration(
292+
auto *const F = Intrinsic::getOrInsertDeclaration(
294293
B.GetInsertBlock()->getModule(), IntrinsicOp, Val->getType());
295294
assert(F && "Could not declare vector-predicated reduction intrinsic");
296295

llvm/lib/SYCLNativeCPUUtils/compiler_passes/vecz/source/transform/pre_linearize_pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ InstructionCost calculateBoolReductionCost(LLVMContext &context, Module *module,
120120
auto *F = Function::Create(new_fty, Function::InternalLinkage, "tmp", module);
121121
auto *BB = BasicBlock::Create(context, "reduce", F);
122122
IRBuilder<> B(BB);
123-
multi_llvm::createSimpleReduction(B, &*F->arg_begin(), RecurKind::And);
123+
createSimpleReduction(B, &*F->arg_begin(), RecurKind::And);
124124
const InstructionCost cost = calculateBlockCost(*BB, TTI);
125125

126126
// We don't really need that function in the module anymore because it's

0 commit comments

Comments
 (0)