Skip to content

Commit 0752339

Browse files
committed
attempt to actually set -disable-copyprop attribute correctly
1 parent ba81c05 commit 0752339

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/codegen.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5529,6 +5529,10 @@ static void init_julia_llvm_env(Module *m)
55295529

55305530
extern "C" void jl_init_codegen(void)
55315531
{
5532+
#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
5533+
const char *const argv[] = {"", "-disable-copyprop"}; // llvm bug 21743
5534+
cl::ParseCommandLineOptions(sizeof(argv)/sizeof(argv[0]), argv, "disable-copyprop\n");
5535+
#endif
55325536
#ifdef JL_DEBUG_BUILD
55335537
cl::ParseEnvironmentOptions("Julia", "JULIA_LLVM_ARGS");
55345538
#endif
@@ -5597,19 +5601,17 @@ extern "C" void jl_init_codegen(void)
55975601
#endif
55985602
#ifdef USE_MCJIT
55995603
jl_mcjmm = new SectionMemoryManager();
5600-
SmallVector<std::string, 4> MAttrs;
5601-
#else
5602-
// Temporarily disable Haswell BMI2 features due to LLVM bug.
5603-
const char *mattr[] = {"-bmi2", "-avx2"
5604-
#ifdef V128_BUG
5605-
,"-avx"
56065604
#endif
5607-
#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
5608-
,"-disable-copyprop" // llvm bug 21743
5605+
const char *mattr[] = {
5606+
#ifndef USE_MCJIT
5607+
// Temporarily disable Haswell BMI2 features due to LLVM bug.
5608+
"-bmi2", "-avx2",
56095609
#endif
5610-
};
5611-
SmallVector<std::string, 4> MAttrs(mattr, mattr+2);
5610+
#ifdef V128_BUG
5611+
"-avx",
56125612
#endif
5613+
};
5614+
SmallVector<std::string, 4> MAttrs(mattr, mattr+sizeof(mattr)/sizeof(mattr[0]));
56135615
#ifdef LLVM36
56145616
EngineBuilder eb(std::move(std::unique_ptr<Module>(engine_module)));
56155617
#else

0 commit comments

Comments
 (0)