about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-12 20:36:51 +0100
committerGitHub <noreply@github.com>2020-02-12 20:36:51 +0100
commitf127aba96d1f0610f854e54a3386023c2331b1f3 (patch)
treea3fe45dbbbb7b48ef6155e47fb828fe50a625d24 /src/rustllvm/RustWrapper.cpp
parent2d2be570970d784db5539a1d309cd22b85be910a (diff)
parentc6b0803202c95abd614c8ea448f7c7ff948da31a (diff)
downloadrust-f127aba96d1f0610f854e54a3386023c2331b1f3.tar.gz
rust-f127aba96d1f0610f854e54a3386023c2331b1f3.zip
Rollup merge of #67954 - nikic:new-pm, r=nagisa
Support new LLVM pass manager

Add support for the new LLVM pass manager behind a `-Z new-llvm-pass-manager=on` option. Both the pre-link optimization and LTO pipelines use the new pass manager. There's some bits that are not supported yet:

 * `-C passes`. NewPM requires an entirely different way of specifying custom pass pipelines. We should probably expose that functionality, but it doesn't directly map to what `-C passes` does.
 * NewPM has no support for custom inline parameters right now. We'd have to add upstream support for that first.
 * NewPM does not support PGO at O0 in LLVM 9 (which is why those tests fail with NewPM enabled). This is supported in LLVM 10.
 * NewPM does not support MergeFunctions in LLVM 9. I've landed this upstream just before the cut, so we'll be able to re-enable that with LLVM 10.

Closes #64289.

r? @ghost
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 46e467011b9..49b6e1bfec3 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1296,6 +1296,14 @@ extern "C" LLVMValueRef LLVMRustBuildMemMove(LLVMBuilderRef B,
 #endif
 }
 
+extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B,
+                                            LLVMValueRef Dst, unsigned DstAlign,
+                                            LLVMValueRef Val,
+                                            LLVMValueRef Size, bool IsVolatile) {
+  return wrap(unwrap(B)->CreateMemSet(
+      unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
+}
+
 extern "C" LLVMValueRef
 LLVMRustBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args,
                     unsigned NumArgs, LLVMBasicBlockRef Then,