[llvm] r209222 - Avoids DCE on write_register
Renato Golin
renato.golin at linaro.org
Tue May 20 10:40:03 PDT 2014
Author: rengolin
Date: Tue May 20 12:40:03 2014
New Revision: 209222
URL: http://llvm.org/viewvc/llvm-project?rev=209222&view=rev
Log:
Avoids DCE on write_register
Modified:
llvm/trunk/include/llvm/IR/Intrinsics.td
llvm/trunk/test/CodeGen/X86/stackpointer.ll
Modified: llvm/trunk/include/llvm/IR/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Intrinsics.td?rev=209222&r1=209221&r2=209222&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/IR/Intrinsics.td Tue May 20 12:40:03 2014
@@ -253,7 +253,7 @@ def int_frameaddress : Intrinsic<[llvm_
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.
Modified: llvm/trunk/test/CodeGen/X86/stackpointer.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stackpointer.ll?rev=209222&r1=209221&r2=209222&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/stackpointer.ll (original)
+++ llvm/trunk/test/CodeGen/X86/stackpointer.ll Tue May 20 12:40:03 2014
@@ -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
}
More information about the llvm-commits
mailing list