From bc96516a28d9e8e816b0f45c628a9cd49a2f380d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 20 Feb 2021 17:02:23 +0100 Subject: Mark pure asm as willreturn --- compiler/rustc_codegen_llvm/src/asm.rs | 1 + compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 1 + 2 files changed, 2 insertions(+) (limited to 'compiler/rustc_codegen_llvm/src') diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs index 26815de403f..38c8ae711a4 100644 --- a/compiler/rustc_codegen_llvm/src/asm.rs +++ b/compiler/rustc_codegen_llvm/src/asm.rs @@ -304,6 +304,7 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { } else if options.contains(InlineAsmOptions::READONLY) { llvm::Attribute::ReadOnly.apply_callsite(llvm::AttributePlace::Function, result); } + llvm::Attribute::WillReturn.apply_callsite(llvm::AttributePlace::Function, result); } else if options.contains(InlineAsmOptions::NOMEM) { llvm::Attribute::InaccessibleMemOnly .apply_callsite(llvm::AttributePlace::Function, result); diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 7f7575e58c9..e6d60044c84 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -132,6 +132,7 @@ pub enum Attribute { ReadNone = 26, InaccessibleMemOnly = 27, SanitizeHWAddress = 28, + WillReturn = 29, } /// LLVMIntPredicate -- cgit 1.4.1-3-g733a5