diff --git a/src/codegen.cpp b/src/codegen.cpp index e178a4597c861..64fdadb1d2f8a 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -35,6 +35,7 @@ #include #include #ifdef LLVM37 +#include #include #else #include @@ -5752,7 +5753,9 @@ static void init_julia_llvm_env(Module *m) FPM->add(llvm::createMemorySanitizerPass(true)); # endif #endif -#ifndef LLVM37 +#ifdef LLVM37 + FPM->add(createTargetTransformInfoWrapperPass(jl_TargetMachine->getTargetIRAnalysis())); +#else jl_TargetMachine->addAnalysisPasses(*FPM); #endif #ifdef LLVM38