diff --git a/Makefile b/Makefile index 9d39baa4..f6d7af38 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,10 @@ ifeq ($(LLVM_VERSION),LLVM_3_4) ISPC_LIBS += -lcurses endif +ifeq ($(LLVM_VERSION),LLVM_3_5) + ISPC_LIBS += -lcurses +endif + ifeq ($(ARCH_OS),Linux) ISPC_LIBS += -ldl endif diff --git a/cbackend.cpp b/cbackend.cpp index 5a1ef705..8535653f 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -2196,7 +2196,7 @@ bool CWriter::doInitialization(llvm::Module &M) { #endif TAsm = new CBEMCAsmInfo(); MRI = new llvm::MCRegisterInfo(); -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) TCtx = new llvm::MCContext(TAsm, MRI, NULL); #else TCtx = new llvm::MCContext(*TAsm, *MRI, NULL); diff --git a/ctx.cpp b/ctx.cpp index c50d22f9..c1a7e61a 100644 --- a/ctx.cpp +++ b/ctx.cpp @@ -348,7 +348,7 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym, AssertPos(currentPos, diSubprogramType.Verify()); } -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) Assert(diSubprogramType.isCompositeType()); llvm::DICompositeType diSubprogramType_n = static_cast(diSubprogramType); diff --git a/ispc.cpp b/ispc.cpp index de01fdfb..36d31580 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -312,7 +312,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 4; this->m_attributes = "+sse,+sse2,-sse3,-sse4a,-ssse3,-popcnt" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",-sse4.1,-sse4.2" #else ",-sse41,-sse42" @@ -328,7 +328,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 8; this->m_attributes = "+sse,+sse2,-sse3,-sse4a,-ssse3,-popcnt" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",-sse4.1,-sse4.2" #else ",-sse41,-sse42" @@ -345,7 +345,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_vectorWidth = 4; // TODO: why not sse42 and popcnt? this->m_attributes = "+sse,+sse2,+sse3,-sse4a,+ssse3,-popcnt,+cmov" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+sse4.1,-sse4.2" #else ",+sse41,-sse42" @@ -362,7 +362,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 8; this->m_attributes = "+sse,+sse2,+sse3,-sse4a,+ssse3,-popcnt,+cmov" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+sse4.1,-sse4.2" #else ",+sse41,-sse42" @@ -377,7 +377,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 8; this->m_vectorWidth = 16; this->m_attributes = "+sse,+sse2,+sse3,-sse4a,+ssse3,-popcnt,+cmov" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+sse4.1,-sse4.2" #else ",+sse41,-sse42" @@ -392,7 +392,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 16; this->m_vectorWidth = 8; this->m_attributes = "+sse,+sse2,+sse3,-sse4a,+ssse3,-popcnt,+cmov" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+sse4.1,-sse4.2" #else ",+sse41,-sse42" @@ -512,7 +512,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 8; this->m_attributes = "+avx,+popcnt,+cmov,+f16c" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+rdrnd" #else ",+rdrand" @@ -533,7 +533,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 16; this->m_attributes = "+avx,+popcnt,+cmov,+f16c" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+rdrnd" #else ",+rdrand" @@ -553,7 +553,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 64; this->m_vectorWidth = 4; this->m_attributes = "+avx,+popcnt,+cmov,+f16c" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+rdrnd" #else ",+rdrand" @@ -574,7 +574,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 8; this->m_attributes = "+avx2,+popcnt,+cmov,+f16c" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+rdrnd" #else ",+rdrand" @@ -599,7 +599,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 32; this->m_vectorWidth = 16; this->m_attributes = "+avx2,+popcnt,+cmov,+f16c" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+rdrnd" #else ",+rdrand" @@ -623,7 +623,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_dataTypeWidth = 64; this->m_vectorWidth = 4; this->m_attributes = "+avx2,+popcnt,+cmov,+f16c" -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) ",+rdrnd" #else ",+rdrand" diff --git a/ispc.h b/ispc.h index 2207cdde..b319d656 100644 --- a/ispc.h +++ b/ispc.h @@ -40,8 +40,8 @@ #define ISPC_VERSION "1.5.1dev" -#if !defined(LLVM_3_1) && !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) -#error "Only LLVM 3.1, 3.2, 3.3 and the 3.4 development branch are supported" +#if !defined(LLVM_3_1) && !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) +#error "Only LLVM 3.1, 3.2, 3.3, 3.4 and the 3.5 development branch are supported" #endif #if defined(_WIN32) || defined(_WIN64) diff --git a/main.cpp b/main.cpp index 21a47de8..99497af5 100644 --- a/main.cpp +++ b/main.cpp @@ -70,6 +70,8 @@ lPrintVersion() { "3.3" #elif defined(LLVM_3_4) "3.4" +#elif defined(LLVM_3_5) + "3.5" #else #error "Unhandled LLVM version" #endif @@ -164,7 +166,7 @@ devUsage(int ret) { printf(" disable-uniform-memory-optimizations\tDisable uniform-based coherent memory access\n"); printf(" [--yydebug]\t\t\t\tPrint debugging information during parsing\n"); printf(" [--debug-phase=]\t\tSet optimization phases to dump. --debug-phase=first,210:220,300,305,310:last\n"); -#ifdef LLVM_3_4 +#if defined(LLVM_3_4) || defined(LLVM_3_5) printf(" [--debug-ir=]\t\tSet optimization phase to generate debugIR after it\n"); #endif printf(" [--off-phase=]\t\tSwitch off optimization phases. --off-phase=first,210:220,300,305,310:last\n"); @@ -547,7 +549,7 @@ int main(int Argc, char *Argv[]) { "away or introduce the new ones.\n"); g->debug_stages = ParsingPhases(argv[i] + strlen("--debug-phase=")); } -#ifdef LLVM_3_4 +#if defined(LLVM_3_4) || defined(LLVM_3_5) else if (strncmp(argv[i], "--debug-ir=", 11) == 0) { g->debugIR = ParsingPhaseName(argv[i] + strlen("--debug-ir=")); } diff --git a/opt.cpp b/opt.cpp index ce84744a..8df0f4fe 100644 --- a/opt.cpp +++ b/opt.cpp @@ -63,7 +63,7 @@ #include #include #endif -#if defined (LLVM_3_4) +#if defined (LLVM_3_4) || defined(LLVM_3_5) #include #endif #include @@ -441,7 +441,7 @@ DebugPassManager::add(llvm::Pass * P, int stage = -1) { number, P->getPassName()); PM.add(CreateDebugPass(buf)); } -#ifdef LLVM_3_4 +#if defined(LLVM_3_4) || defined(LLVM_3_5) if (g->debugIR == number) { // adding generating of LLVM IR debug after optimization char buf[100]; diff --git a/type.cpp b/type.cpp index 5fa1845b..08013af0 100644 --- a/type.cpp +++ b/type.cpp @@ -2879,7 +2879,7 @@ FunctionType::GetDIType(llvm::DIDescriptor scope) const { for (int i = 0; i < GetNumParameters(); ++i) { const Type *t = GetParameterType(i); if (t == NULL) -#if defined(LLVM_3_4) +#if defined(LLVM_3_4) || defined(LLVM_3_5) return llvm::DICompositeType(); #else return llvm::DIType();