diff --git a/include/llvm/IR/Intrinsics.td b/include/llvm/IR/Intrinsics.td index 8ad24b37f74..2ba230a0978 100644 --- a/include/llvm/IR/Intrinsics.td +++ b/include/llvm/IR/Intrinsics.td @@ -253,7 +253,7 @@ def int_frameaddress : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], [IntrNoMem]>; def int_read_register : Intrinsic<[llvm_anyint_ty], [llvm_metadata_ty], [IntrNoMem], "llvm.read_register">; def int_write_register : Intrinsic<[], [llvm_metadata_ty, llvm_anyint_ty], - [IntrNoMem], "llvm.write_register">; + [], "llvm.write_register">; // Note: we treat stacksave/stackrestore as writemem because we don't otherwise // model their dependencies on allocas. diff --git a/test/CodeGen/X86/stackpointer.ll b/test/CodeGen/X86/stackpointer.ll index 26f9999fd5d..80bcfbf1674 100644 --- a/test/CodeGen/X86/stackpointer.ll +++ b/test/CodeGen/X86/stackpointer.ll @@ -1,11 +1,13 @@ ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s ; RUN: llc < %s -mtriple=x86_64-linux-gnueabi | FileCheck %s +; RUN: opt < %s -O3 -S -mtriple=x86_64-linux-gnueabi | FileCheck %s --check-prefix=OPT define i64 @get_stack() nounwind { entry: ; CHECK-LABEL: get_stack: ; CHECK: movq %rsp, %rax %sp = call i64 @llvm.read_register.i64(metadata !0) +; OPT: @llvm.read_register.i64 ret i64 %sp } @@ -14,6 +16,7 @@ entry: ; CHECK-LABEL: set_stack: ; CHECK: movq %rdi, %rsp call void @llvm.write_register.i64(metadata !0, i64 %val) +; OPT: @llvm.write_register.i64 ret void }