Skip to content

Commit 64dd9c0

Browse files
authored
Merge pull request #4772 from liushuyu/llvm-19
Add LLVM 19.1.x support for LDC
2 parents 00a4493 + 3f6cf2e commit 64dd9c0

38 files changed

+11073
-38
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ install_ubuntu_prerequisites_template: &INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
202202
environment:
203203
CIRRUS_CLONE_DEPTH: 50
204204
HOST_LDC_VERSION: 1.31.0
205-
LLVM_VERSION: 18.1.8
205+
LLVM_VERSION: 19.1.3
206206
GITHUB_TOKEN: ENCRYPTED[0955bd48c8d4e5391446fc0149d0719ad0b63df27ec9e6c180a5730a5b10dc7f28f09d1383423db158d21380ee2b022a]
207207

208208
task:

.github/actions/3-build-cross/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
default: false
1515
android_ndk_version:
1616
required: false
17-
default: r27
17+
default: r27c
1818
android_api_level:
1919
required: false
2020
default: 29

.github/actions/3-build-cross/android-llvm-config.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ LIBFILE="${prefix}/lib/libLLVM-$version.so"
5252

5353
components="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils \
5454
aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils \
55-
asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen codegentypes core coroutines coverage \
55+
asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen codegendata codegentypes core coroutines coverage \
5656
debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp \
5757
engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hipstdpar instcombine \
5858
instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler \
5959
mcjit mcparser mirparser native nativecodegen objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess \
60-
passes profiledata remarks runtimedyld scalaropts selectiondag spirv spirvcodegen spirvdesc spirvinfo support symbolize tablegen target targetparser textapi \
60+
passes profiledata remarks runtimedyld sandboxir scalaropts selectiondag spirv spirvanalysis spirvcodegen spirvdesc spirvinfo support symbolize tablegen target targetparser textapi \
6161
textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler \
6262
webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info \
6363
x86targetmca xray"
6464
static_libs="-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor \
65-
-lLLVMSPIRVCodeGen -lLLVMSPIRVDesc -lLLVMSPIRVInfo \
65+
-lLLVMSandboxIR -lLLVMSPIRVCodeGen -lLLVMSPIRVDesc -lLLVMSPIRVInfo -lLLVMSPIRVAnalysis \
6666
-lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMWebAssemblyDisassembler \
6767
-lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyUtils -lLLVMWebAssemblyDesc -lLLVMWebAssemblyInfo -lLLVMARMDisassembler \
6868
-lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAArch64Disassembler \
@@ -71,7 +71,7 @@ static_libs="-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDrive
7171
-lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA \
7272
-lLLVMMCDisassembler -lLLVMLTO -lLLVMPasses -lLLVMHipStdPar -lLLVMCFGuard -lLLVMCoroutines -lLLVMipo \
7373
-lLLVMVectorize -lLLVMLinker -lLLVMInstrumentation -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMExtensions \
74-
-lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG \
74+
-lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMCodeGenData -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG \
7575
-lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate \
7676
-lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis \
7777
-lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView \

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
env:
1313
CLANG_VERSION: 15.0.6
14-
LLVM_VERSION: 18.1.8
14+
LLVM_VERSION: 19.1.3
1515

1616
jobs:
1717
build-native:
@@ -97,7 +97,7 @@ jobs:
9797
- name: Install prerequisites
9898
uses: ./.github/actions/1-setup
9999
with:
100-
clang_version: ${{ runner.os == 'Windows' && '18.1.8' || env.CLANG_VERSION }}
100+
clang_version: ${{ runner.os == 'Windows' && '19.1.3' || env.CLANG_VERSION }}
101101
llvm_version: ${{ matrix.llvm_version || env.LLVM_VERSION }}
102102
arch: ${{ matrix.arch }}
103103
- name: Build bootstrap LDC

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
#### Big news
44
- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707, #4737, #4749, #4768, #4784)
5-
- LLVM for prebuilt packages bumped to v18.1.8 (incl. macOS arm64). (#4712)
6-
- Android: NDK for prebuilt package bumped from r26d to r27. (#4711)
5+
- Support for [LLVM 19](https://releases.llvm.org/19.1.0/docs/ReleaseNotes.html); LLVM for prebuilt packages bumped to v19.1.3 (incl. macOS arm64). (#4712, #4735, #4763, #4772)
6+
- Android: NDK for prebuilt package bumped from r26d to r27c. (#4711, #4772)
77
- ldc2.conf: %%ldcconfigpath%% placeholder added - specifies the directory where current configuration file is located. (#4717)
88
- Add support for building against a system copy of zlib through `-DPHOBOS_SYSTEM_ZLIB=ON`. (#4742)
99
- Emscripten: The compiler now mimicks a musl Linux platform wrt. extra predefined versions (`linux`, `Posix`, `CRuntime_Musl`, `CppRuntime_LLVM`). (#4750)
1010

1111
#### Platform support
12+
- Supports LLVM 15 - 19.
1213

1314
#### Bug fixes
1415
- Fix potentially corrupt IR layouts for bit fields. (#4646, #4708)
1516
- Fix potentially corrupt IR layouts for explicitly under-aligned aggregates, a regression introduced in LDC v1.31. (#4734, #4736)
1617
- ELF: Emit (most) instantiated symbols in COMDATs for proper link-time culling. (#3589, #4748)
1718
- Support scalar right-hand-sides when bit-shifting vectors. (#3606, #4781)
19+
- Fix LLVM data layout for the SPIR-V target used in D-Compute on LLVM 19+. (#4772)
1820

1921
# LDC 1.39.0 (2024-07-04)
2022

cmake/Modules/FindLLVM.cmake

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
# We also want an user-specified LLVM_ROOT_DIR to take precedence over the
3333
# system default locations such as /usr/local/bin. Executing find_program()
3434
# multiples times is the approach recommended in the docs.
35-
set(llvm_config_names llvm-config-18.1 llvm-config181 llvm-config-18
35+
set(llvm_config_names llvm-config-19.1 llvm-config191 llvm-config-19
36+
llvm-config-18.1 llvm-config181 llvm-config-18
3637
llvm-config-17.0 llvm-config170 llvm-config-17
3738
llvm-config-16.0 llvm-config160 llvm-config-16
3839
llvm-config-15.0 llvm-config150 llvm-config-15
@@ -46,9 +47,11 @@ if(APPLE)
4647
# extra fallbacks for MacPorts & Homebrew
4748
find_program(LLVM_CONFIG
4849
NAMES ${llvm_config_names}
49-
PATHS /opt/local/libexec/llvm-18/bin /opt/local/libexec/llvm-17/bin
50+
PATHS /opt/local/libexec/llvm-19/bin
51+
/opt/local/libexec/llvm-18/bin /opt/local/libexec/llvm-17/bin
5052
/opt/local/libexec/llvm-16/bin /opt/local/libexec/llvm-15/bin
5153
/opt/local/libexec/llvm/bin
54+
/usr/local/opt/llvm@19/bin
5255
/usr/local/opt/llvm@18/bin /usr/local/opt/llvm@17/bin
5356
/usr/local/opt/llvm@16/bin /usr/local/opt/llvm@15/bin
5457
/usr/local/opt/llvm/bin
@@ -138,11 +141,6 @@ else()
138141
string(REPLACE "-llibxml2.tbd" "-lxml2" LLVM_LDFLAGS ${LLVM_LDFLAGS})
139142
endif()
140143

141-
if(${LLVM_VERSION_MAJOR} LESS "15")
142-
# Versions below 15.0 do not support component windowsdriver
143-
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "windowsdriver")
144-
endif()
145-
146144
llvm_set(LIBRARY_DIRS libdir true)
147145
llvm_set_libs(LIBRARIES libs "${LLVM_FIND_COMPONENTS}")
148146
# LLVM bug: llvm-config --libs tablegen returns -lLLVM-3.8.0

gen/arrays.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static void emitRangeErrorImpl(IRState *irs, const Loc &loc,
10711071
DtoCAssert(module, loc, DtoConstCString(cAssertMsg));
10721072
break;
10731073
case CHECKACTION_halt:
1074-
irs->ir->CreateCall(GET_INTRINSIC_DECL(trap), {});
1074+
irs->ir->CreateCall(GET_INTRINSIC_DECL(trap, {}), {});
10751075
irs->ir->CreateUnreachable();
10761076
break;
10771077
case CHECKACTION_context:

gen/dcompute/targetOCL.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <string>
2525

2626
// from SPIRVInternal.h
27+
#if LDC_LLVM_VER < 1900
2728
#define SPIR_TARGETTRIPLE32 "spir-unknown-unknown"
2829
#define SPIR_TARGETTRIPLE64 "spir64-unknown-unknown"
2930
#define SPIR_DATALAYOUT32 \
@@ -38,6 +39,16 @@
3839
"-v32:32:32-v48:64:64-v64:64:64-v96:128:128" \
3940
"-v128:128:128-v192:256:256-v256:256:256" \
4041
"-v512:512:512-v1024:1024:1024"
42+
#else
43+
#define SPIR_TARGETTRIPLE32 "spirv-unknown-unknown"
44+
#define SPIR_TARGETTRIPLE64 "spirv64-unknown-unknown"
45+
#define SPIR_DATALAYOUT32 \
46+
"e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64" \
47+
"-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
48+
#define SPIR_DATALAYOUT64 \
49+
"e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128" \
50+
"-v192:256-v256:256-v512:512-v1024:1024-G1"
51+
#endif
4152

4253
using namespace dmd;
4354

gen/dibuilder.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,10 +1137,13 @@ void DIBuilder::EmitValue(llvm::Value *val, VarDeclaration *vd) {
11371137
if (!mustEmitFullDebugInfo() || !debugVariable)
11381138
return;
11391139

1140-
llvm::Instruction *instr = DBuilder.insertDbgValueIntrinsic(
1140+
auto instr = DBuilder.insertDbgValueIntrinsic(
11411141
val, debugVariable, DBuilder.createExpression(),
11421142
IR->ir->getCurrentDebugLocation(), IR->scopebb());
1143-
instr->setDebugLoc(IR->ir->getCurrentDebugLocation());
1143+
#if LDC_LLVM_VER >= 1900
1144+
llvm::cast<llvm::DbgRecord *>
1145+
#endif
1146+
(instr)->setDebugLoc(IR->ir->getCurrentDebugLocation());
11441147
}
11451148

11461149
void DIBuilder::EmitLocalVariable(llvm::Value *ll, VarDeclaration *vd,

gen/functions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
12541254
// initialize _argptr with a call to the va_start intrinsic
12551255
DLValue argptrVal(tvalist, argptrMem);
12561256
LLValue *llAp = gABI->prepareVaStart(&argptrVal);
1257-
llvm::CallInst::Create(GET_INTRINSIC_DECL(vastart), llAp, "",
1257+
llvm::CallInst::Create(GET_INTRINSIC_DECL(vastart, llAp->getType()), llAp, "",
12581258
gIR->scopebb());
12591259

12601260
// copy _arguments to a memory location
@@ -1265,7 +1265,7 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
12651265
auto *vaendBB = llvm::BasicBlock::Create(gIR->context(), "vaend", func);
12661266
const auto savedInsertPoint = gIR->saveInsertPoint();
12671267
gIR->ir->SetInsertPoint(vaendBB);
1268-
gIR->ir->CreateCall(GET_INTRINSIC_DECL(vaend), llAp);
1268+
gIR->ir->CreateCall(GET_INTRINSIC_DECL(vaend, llAp->getType()), llAp);
12691269
funcGen.scopes.pushCleanup(vaendBB, gIR->scopebb());
12701270
}
12711271
}

gen/llvm.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ using llvm::APFloat;
3535
using llvm::APInt;
3636
using llvm::IRBuilder;
3737

38-
#define GET_INTRINSIC_DECL(_X) \
38+
#if LDC_LLVM_VER >= 1900
39+
#define GET_INTRINSIC_DECL(_X, _TY) \
40+
(llvm::Intrinsic::getDeclaration(&gIR->module, llvm::Intrinsic::_X, _TY))
41+
#else
42+
#define GET_INTRINSIC_DECL(_X, _TY) \
3943
(llvm::Intrinsic::getDeclaration(&gIR->module, llvm::Intrinsic::_X))
44+
#endif
4045

4146
// shortcuts for the common llvm types
4247

gen/optimizer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ static llvm::Optional<PGOOptions> getPGOOptions() {
308308
"" /*MemoryProfileUsePath*/, llvm::vfs::getRealFileSystem(),
309309
#endif
310310
PGOOptions::PGOAction::IRInstr, PGOOptions::CSPGOAction::NoCSAction,
311+
#if LDC_LLVM_VER >= 1900
312+
PGOOptions::ColdFuncOpt::Default,
313+
#endif
311314
debugInfoForProfiling, pseudoProbeForProfiling);
312315
} else if (opts::isUsingIRBasedPGOProfile()) {
313316
return PGOOptions(
@@ -316,6 +319,9 @@ static llvm::Optional<PGOOptions> getPGOOptions() {
316319
"" /*MemoryProfileUsePath*/, llvm::vfs::getRealFileSystem(),
317320
#endif
318321
PGOOptions::PGOAction::IRUse, PGOOptions::CSPGOAction::NoCSAction,
322+
#if LDC_LLVM_VER >= 1900
323+
PGOOptions::ColdFuncOpt::Default,
324+
#endif
319325
debugInfoForProfiling, pseudoProbeForProfiling);
320326
} else if (opts::isUsingSampleBasedPGOProfile()) {
321327
return PGOOptions(
@@ -324,6 +330,9 @@ static llvm::Optional<PGOOptions> getPGOOptions() {
324330
"" /*MemoryProfileUsePath*/, llvm::vfs::getRealFileSystem(),
325331
#endif
326332
PGOOptions::PGOAction::SampleUse, PGOOptions::CSPGOAction::NoCSAction,
333+
#if LDC_LLVM_VER >= 1900
334+
PGOOptions::ColdFuncOpt::Default,
335+
#endif
327336
debugInfoForProfiling, pseudoProbeForProfiling);
328337
}
329338
#if LDC_LLVM_VER < 1600

gen/pgo_ASTbased.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ void CodeGenPGO::emitCounterIncrement(const RootObject *S) const {
909909
assert(counter_it != (*RegionCounterMap).end() &&
910910
"Statement not found in PGO counter map!");
911911
unsigned counter = counter_it->second;
912-
gIR->ir->CreateCall(GET_INTRINSIC_DECL(instrprof_increment),
912+
gIR->ir->CreateCall(GET_INTRINSIC_DECL(instrprof_increment, {}),
913913
{FuncNameVar, gIR->ir->getInt64(FunctionHash),
914914
gIR->ir->getInt32(NumRegionCounters),
915915
gIR->ir->getInt32(counter)});
@@ -1118,7 +1118,7 @@ void CodeGenPGO::valueProfile(uint32_t valueKind, llvm::Instruction *valueSite,
11181118
llvm::Value *Args[5] = {FuncNameVar, gIR->ir->getInt64(FunctionHash), value,
11191119
gIR->ir->getInt32(valueKind),
11201120
gIR->ir->getInt32(NumValueSites[valueKind])};
1121-
gIR->ir->CreateCall(GET_INTRINSIC_DECL(instrprof_value_profile), Args);
1121+
gIR->ir->CreateCall(GET_INTRINSIC_DECL(instrprof_value_profile, {}), Args);
11221122

11231123
gIR->ir->restoreIP(savedInsertPoint);
11241124

gen/runtime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ static void emitInstrumentationFn(const char *name) {
887887

888888
// Grab the address of the calling function
889889
auto *caller =
890-
gIR->ir->CreateCall(GET_INTRINSIC_DECL(returnaddress), DtoConstInt(0));
890+
gIR->ir->CreateCall(GET_INTRINSIC_DECL(returnaddress, {}), DtoConstInt(0));
891891
auto callee = gIR->topfunc();
892892

893893
gIR->ir->CreateCall(fn, {callee, caller});

gen/tocall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ bool DtoLowerMagicIntrinsic(IRState *p, FuncDeclaration *fndecl, CallExp *e,
273273
gABI->vaCopy(ap, &argptr);
274274
} else {
275275
LLValue *llAp = gABI->prepareVaStart(ap);
276-
p->ir->CreateCall(GET_INTRINSIC_DECL(vastart), llAp, "");
276+
p->ir->CreateCall(GET_INTRINSIC_DECL(vastart, llAp->getType()), llAp, "");
277277
}
278278
result = nullptr;
279279
return true;
@@ -321,7 +321,7 @@ bool DtoLowerMagicIntrinsic(IRState *p, FuncDeclaration *fndecl, CallExp *e,
321321
DLValue *ap = toElem((*e->arguments)[0])->isLVal(); // va_list
322322
assert(ap);
323323
LLValue *llAp = gABI->prepareVaArg(ap);
324-
p->ir->CreateCall(GET_INTRINSIC_DECL(vaend), llAp);
324+
p->ir->CreateCall(GET_INTRINSIC_DECL(vaend, llAp->getType()), llAp);
325325
result = nullptr;
326326
return true;
327327
}

gen/toir.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ class ToElemVisitor : public Visitor {
809809
// access to the type of the class to do a GEP).
810810
auto vtable = DtoLoad(dfnval->vtable->getType(), dfnval->vthis);
811811
auto cmp = p->ir->CreateICmpEQ(vtable, dfnval->vtable);
812-
p->ir->CreateCall(GET_INTRINSIC_DECL(assume), {cmp});
812+
p->ir->CreateCall(GET_INTRINSIC_DECL(assume, {}), {cmp});
813813
}
814814

815815
if (delayedDtorVar) {
@@ -1766,7 +1766,7 @@ class ToElemVisitor : public Visitor {
17661766
p->ir->SetInsertPoint(failedbb);
17671767

17681768
if (global.params.checkAction == CHECKACTION_halt) {
1769-
p->ir->CreateCall(GET_INTRINSIC_DECL(trap), {});
1769+
p->ir->CreateCall(GET_INTRINSIC_DECL(trap, {}), {});
17701770
p->ir->CreateUnreachable();
17711771
} else {
17721772
/* DMD Bugzilla 8360: If the condition is evaluated to true,
@@ -1923,7 +1923,7 @@ class ToElemVisitor : public Visitor {
19231923
IF_LOG Logger::print("HaltExp::toElem: %s\n", e->toChars());
19241924
LOG_SCOPE;
19251925

1926-
p->ir->CreateCall(GET_INTRINSIC_DECL(trap), {});
1926+
p->ir->CreateCall(GET_INTRINSIC_DECL(trap, {}), {});
19271927
p->ir->CreateUnreachable();
19281928

19291929
// this terminated the basicblock, start a new one

gen/trycatchfinally.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ llvm::BasicBlock *TryCatchFinallyScopes::emitLandingPad() {
730730
// "Call" llvm.eh.typeid.for, which gives us the eh selector value to
731731
// compare the landing pad selector value with.
732732
llvm::Value *ehTypeId = irs.ir->CreateCall(
733-
GET_INTRINSIC_DECL(eh_typeid_for), cb.classInfoPtr);
733+
GET_INTRINSIC_DECL(eh_typeid_for, cb.classInfoPtr->getType()), cb.classInfoPtr);
734734

735735
// Compare the selector value from the unwinder against the expected
736736
// one and branch accordingly.

runtime/druntime/src/ldc/intrinsics.di

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ else version (LDC_LLVM_1600) enum LLVM_version = 1600;
2424
else version (LDC_LLVM_1700) enum LLVM_version = 1700;
2525
else version (LDC_LLVM_1800) enum LLVM_version = 1800;
2626
else version (LDC_LLVM_1801) enum LLVM_version = 1801;
27+
else version (LDC_LLVM_1901) enum LLVM_version = 1901;
28+
else version (LDC_LLVM_2000) enum LLVM_version = 2000;
2729
else static assert(false, "LDC LLVM version not supported");
2830

2931
enum LLVM_atleast(int major) = (LLVM_version >= major * 100);

tests/codegen/simd_alignment.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ S17237 globalStruct;
2020
// CHECK-LABEL: define <8 x i32> @foo(
2121
extern(C) int8 foo(S17237* s)
2222
{
23-
// CHECK: %[[GEP:[0-9]]] = getelementptr {{.*}}S17237, ptr %s_arg
23+
// CHECK: %[[GEP:[0-9]]] = getelementptr {{(.*S17237|inbounds i8)}}, ptr %s_arg
2424
// CHECK: = load <8 x i32>, ptr %[[GEP]], align 32
2525
return s.c;
2626
}

tests/codegen/vastart_vaend_gh1744.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module mod;
1212
// OPT3-LABEL: define {{.*}} @{{.*}}void_three_return_paths
1313
void void_three_return_paths(int a, ...)
1414
{
15-
// OPT3: call void @llvm.va_start({{.*}} %[[VA:[_0-9a-zA-Z]+]])
15+
// OPT3: call void @llvm.va_start{{(\.p0)?}}({{.*}} %[[VA:[_0-9a-zA-Z]+]])
1616
// OPT3-NOT: return_two
1717
return_two();
1818

@@ -24,8 +24,8 @@ void void_three_return_paths(int a, ...)
2424

2525
// There are two control paths (normal return, exception resume) that
2626
// should call va_end.
27-
// OPT3: call void @llvm.va_end({{.*}} %[[VA]])
28-
// OPT3: call void @llvm.va_end({{.*}} %[[VA]])
27+
// OPT3: call void @llvm.va_end{{(\.p0)?}}({{.*}} %[[VA]])
28+
// OPT3: call void @llvm.va_end{{(\.p0)?}}({{.*}} %[[VA]])
2929
}
3030

3131
// OPT3-LABEL: define {{.*}} @{{.*}}return_two

tests/codegen/xtensa.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: target_Xtensa
22

3-
// RUN: %ldc -mtriple=xtensa -betterC
3+
// RUN: %ldc -mtriple=xtensa -betterC %s -c -of=%t.o
44

55
version (Xtensa) {} else static assert(0);
66

tests/lit.site.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ config.available_features.add("llvm%d" % config.llvm_version)
8686
# config.llvm_version: 309, 400, 500, ...
8787
# plusoneable_llvmversion: 39, 40, 50, ...
8888
plusoneable_llvmversion = config.llvm_version // 10 + config.llvm_version%10
89-
for version in range(140, plusoneable_llvmversion+1):
89+
for version in range(150, plusoneable_llvmversion+1):
9090
config.available_features.add("atleast_llvm%d0%d" % (version//10, version%10))
9191
for version in range(plusoneable_llvmversion, 201):
9292
config.available_features.add("atmost_llvm%d0%d" % (version//10, version%10))

0 commit comments

Comments
 (0)