summarylogtreecommitdiffstats
path: root/add-faust-llvm90-support.patch
blob: 798dfcc8f7af98be8097bd11dfcd81d7709a30c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
diff -aur --no-dereference radium-5.9.76.pristine/bin/packages/faust.patch radium-5.9.76.new/bin/packages/faust.patch
--- radium-5.9.76.pristine/bin/packages/faust.patch	2019-10-16 18:45:56.000000000 +0100
+++ radium-5.9.76.new/bin/packages/faust.patch	2019-10-19 02:40:13.375925685 +0100
@@ -1,5 +1,5 @@
 diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt
-index ece37cb..e99dfae 100644
+index ece37cb0b..ff2b549e0 100644
 --- a/build/CMakeLists.txt
 +++ b/build/CMakeLists.txt
 @@ -84,8 +84,8 @@ if (INCLUDE_LLVM )
@@ -14,7 +14,7 @@
  	set (FAUST_LIBS ${FAUST_LIBS} ${LLVM_LD_FLAGS} ${LLVM_LIBS})
  	
 diff --git a/build/backends/most.cmake b/build/backends/most.cmake
-index c6333e5..0589c5d 100644
+index c6333e550..0589c5d41 100644
 --- a/build/backends/most.cmake
 +++ b/build/backends/most.cmake
 @@ -8,14 +8,14 @@
@@ -41,3 +41,120 @@
 +set ( RUST_BACKEND   OFF       CACHE STRING  "Include RUST backend"      FORCE )
 +set ( SOUL_BACKEND   OFF         CACHE STRING  "Include SOUL backend"      FORCE )
 +set ( WASM_BACKEND   OFF  WASM   CACHE STRING  "Include WASM backend"      FORCE )
+ 
+diff --git a/compiler/generator/llvm/llvm_code_container.cpp b/compiler/generator/llvm/llvm_code_container.cpp
+index 07df9dc32..1d1c717d8 100644
+--- a/compiler/generator/llvm/llvm_code_container.cpp
++++ b/compiler/generator/llvm/llvm_code_container.cpp
+@@ -71,7 +71,7 @@ LLVMCodeContainer::LLVMCodeContainer(const string& name, int numInputs, int numO
+ 
+     // Set "-fast-math"
+     FastMathFlags FMF;
+-#if defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+     FMF.setFast();  // has replaced the below function
+ #else
+     FMF.setUnsafeAlgebra();
+@@ -91,7 +91,7 @@ LLVMCodeContainer::LLVMCodeContainer(const string& name, int numInputs, int numO
+ 
+     // Set "-fast-math"
+     FastMathFlags FMF;
+-#if defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+     FMF.setFast();  // has replaced the below function
+ #else
+     FMF.setUnsafeAlgebra();
+diff --git a/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp b/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp
+index 55f173e86..a0db47d17 100644
+--- a/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp
++++ b/compiler/generator/llvm/llvm_dynamic_dsp_aux.cpp
+@@ -109,7 +109,7 @@ void llvm_dynamic_dsp_factory_aux::write(ostream* out, bool binary, bool small)
+     string             res;
+     raw_string_ostream out_str(res);
+     if (binary) {
+-#if defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+         WriteBitcodeToFile(*fModule, out_str);
+ #else
+         WriteBitcodeToFile(fModule, out_str);
+@@ -126,7 +126,7 @@ string llvm_dynamic_dsp_factory_aux::writeDSPFactoryToBitcode()
+     string res;
+     
+     raw_string_ostream out(res);
+-#if defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+     WriteBitcodeToFile(*fModule, out);
+ #else
+     WriteBitcodeToFile(fModule, out);
+@@ -143,7 +143,7 @@ bool llvm_dynamic_dsp_factory_aux::writeDSPFactoryToBitcodeFile(const string& bi
+         cerr << "ERROR : writeDSPFactoryToBitcodeFile could not open file : " << err.message();
+         return false;
+     }
+-#if defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+     WriteBitcodeToFile(*fModule, out);
+ #else
+     WriteBitcodeToFile(fModule, out);
+@@ -204,7 +204,7 @@ static void AddOptimizationPasses(PassManagerBase& MPM, FUNCTION_PASS_MANAGER& F
+         }
+         Builder.Inliner = createFunctionInliningPass(Threshold);
+     } else {
+-#if defined(LLVM_50) || defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_50) || defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+         Builder.Inliner = createAlwaysInlinerLegacyPass();
+ #else
+         Builder.Inliner = createAlwaysInlinerPass();
+@@ -263,7 +263,7 @@ bool llvm_dynamic_dsp_factory_aux::initJIT(string& error_msg)
+ 
+     builder.setOptLevel(CodeGenOpt::Aggressive);
+     builder.setEngineKind(EngineKind::JIT);
+-#if !defined(LLVM_60) && !defined(LLVM_70) && !defined(LLVM_80)
++#if !defined(LLVM_60) && !defined(LLVM_70) && !defined(LLVM_80) && !defined(LLVM_90)
+     builder.setCodeModel(CodeModel::JITDefault);
+ #endif
+ 
+@@ -278,7 +278,7 @@ bool llvm_dynamic_dsp_factory_aux::initJIT(string& error_msg)
+     TargetOptions targetOptions;
+ 
+     // -fastmath is activated at IR level, and has to be setup at JIT level also
+-#if !defined(LLVM_50) && !defined(LLVM_60) && !defined(LLVM_70) && !defined(LLVM_80)
++#if !defined(LLVM_50) && !defined(LLVM_60) && !defined(LLVM_70) && !defined(LLVM_80) && !defined(LLVM_90)
+     targetOptions.LessPreciseFPMADOption = true;
+ #endif
+     targetOptions.AllowFPOpFusion       = FPOpFusion::Fast;
+@@ -287,7 +287,7 @@ bool llvm_dynamic_dsp_factory_aux::initJIT(string& error_msg)
+     targetOptions.NoNaNsFPMath          = true;
+     targetOptions.GuaranteedTailCallOpt = true;
+ 
+-#if defined(LLVM_50) || defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_50) || defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+     targetOptions.NoTrappingFPMath = true;
+     targetOptions.FPDenormalMode   = FPDenormal::IEEE;
+ #endif
+@@ -329,7 +329,7 @@ bool llvm_dynamic_dsp_factory_aux::initJIT(string& error_msg)
+         }
+ 
+         if ((debug_var != "") && (debug_var.find("FAUST_LLVM1") != string::npos)) {
+-#if defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+             // TargetRegistry::printRegisteredTargetsForVersion(cout);
+ #else
+             TargetRegistry::printRegisteredTargetsForVersion();
+@@ -345,7 +345,7 @@ bool llvm_dynamic_dsp_factory_aux::initJIT(string& error_msg)
+         pm.add(createVerifierPass());
+ 
+         if ((debug_var != "") && (debug_var.find("FAUST_LLVM4") != string::npos)) {
+-#if defined(LLVM_50) || defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_50) || defined(LLVM_60) || defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+             // TODO
+ #else
+             tm->addPassesToEmitFile(pm, fouts(), TargetMachine::CGFT_AssemblyFile, true);
+@@ -524,7 +524,7 @@ bool llvm_dynamic_dsp_factory_aux::writeDSPFactoryToObjectcodeFileAux(const stri
+     legacy::PassManager pass;
+     auto                FileType = TargetMachine::CGFT_ObjectFile;
+ 
+-#if defined(LLVM_70) || defined(LLVM_80)
++#if defined(LLVM_70) || defined(LLVM_80) || defined(LLVM_90)
+     if (TheTargetMachine->addPassesToEmitFile(pass, dest, nullptr, FileType)) {
+ #else
+     if (TheTargetMachine->addPassesToEmitFile(pass, dest, FileType, true)) {