diff --git a/src/codegen.cpp b/src/codegen.cpp index 3edcd2c6c974f2..747d7c46db633c 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