Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

## LLVM.jl v10.1

LLVM 23 is supported. Its conditional and unconditional branch opcodes are exposed as
`LLVM.Opcode.CondBr` and `LLVM.Opcode.UncondBr`; both use `BrInst`.
Byte types and constants use `ByteType` and `ConstantByte`.
Size optimization pipelines (`Os`, `Oz`) were removed in LLVM 23; use `O2` with
`optsize` or `minsize` function attributes instead.

### Analyses

Custom passes written in Julia can now use LLVM's analyses. A function pass created with
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ BFloat16sExt = "BFloat16s"
[compat]
BFloat16s = "0.4, 0.5, 0.6"
CEnum = "0.2, 0.3, 0.4, 0.5"
LLVMExtra_jll = "=0.0.51"
LLVMExtra_jll = "=0.0.52"
Libdl = "1.8"
PrecompileTools = "1"
Preferences = "1.4"
Expand Down
2 changes: 2 additions & 0 deletions deps/LLVMExtra/include/LLVMExtra.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <llvm-c/Target.h>
#include <llvm-c/Transforms/PassBuilder.h>
#include <llvm-c/Types.h>
#ifdef __cplusplus
#include <llvm/Support/CBindingWrapping.h>
#endif

LLVM_C_EXTERN_C_BEGIN

Expand Down
9 changes: 9 additions & 0 deletions deps/LLVMExtra/lib/Analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ LLVMBool LLVMExtraComputeConstantRange(LLVMValueRef V, LLVMBool ForSigned,
return false;
auto *Ctx = CxtI ? unwrap<Instruction>(CxtI) : nullptr;
#if LLVM_VERSION_MAJOR >= 23
if (auto *CI = dyn_cast<ConstantInt>(Val)) {
writeRange(ConstantRange(CI->getValue()), Lower, Upper);
return true;
}
const DataLayout *Layout = queryDataLayout(DL, Val, Ctx);
if (!Layout)
return false;
Expand Down Expand Up @@ -406,7 +410,12 @@ LLVMSCEVRef LLVMExtraScalarEvolutionGetAddExpr(LLVMScalarEvolutionRef SE, LLVMSC
Operands.push_back(unwrap(Ops[I]));
if (Operands.empty() || !areCompatibleOperands(*unwrap(SE), Operands, 1))
return nullptr;
#if LLVM_VERSION_MAJOR >= 23
SmallVector<SCEVUse, 4> Uses(Operands.begin(), Operands.end());
return wrap(unwrap(SE)->getAddExpr(Uses));
#else
return wrap(unwrap(SE)->getAddExpr(Operands));
#endif
}

LLVMSCEVRef LLVMExtraScalarEvolutionGetMinusSCEV(LLVMScalarEvolutionRef SE, LLVMSCEVRef LHS,
Expand Down
2 changes: 1 addition & 1 deletion deps/LLVMExtra/lib/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ LLVMBool LLVMExtraGetFirstInsertionPt(LLVMBasicBlockRef BB, LLVMValueRef *Before
BasicBlock::iterator It = B->getFirstInsertionPt();
// the end of a terminated block is not a legal insertion point, which happens when the
// terminator is an EH pad (e.g., a catchswitch)
if (It == B->end() && B->getTerminator())
if (It == B->end() && !B->empty() && B->back().isTerminator())
return false;
readInsertionPoint(B, It, Before, Head);
return true;
Expand Down
11 changes: 10 additions & 1 deletion deps/LLVMExtra/lib/NewPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,16 @@ class CustomTargetTransformInfo final
}
#endif

#if LLVM_VERSION_MAJOR >= 22
#if LLVM_VERSION_MAJOR >= 23
ValueUniformity getValueUniformity(const Value *V) const override {
if (Opts.IsSourceOfDivergence &&
Opts.IsSourceOfDivergence(wrap(V), Opts.IsSourceOfDivergenceUD) != 0)
return ValueUniformity::NeverUniform;
if (Opts.IsAlwaysUniform && Opts.IsAlwaysUniform(wrap(V), Opts.IsAlwaysUniformUD) != 0)
return ValueUniformity::AlwaysUniform;
return BaseT::getValueUniformity(V);
}
#elif LLVM_VERSION_MAJOR >= 22
InstructionUniformity getInstructionUniformity(const Value *V) const override {
if (Opts.IsSourceOfDivergence &&
Opts.IsSourceOfDivergence(wrap(V), Opts.IsSourceOfDivergenceUD) != 0)
Expand Down
Loading
Loading