1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/CodeGen/X86/pr23603.ll
Sanjoy Das ac84e180d5 [SelectionDAG] Fix PR23603.
Summary:
LLVM's MI level notion of invariant_load is different from LLVM's IR
level notion of invariant_load with respect to dereferenceability.  The
IR notion of invariant_load only guarantees that all *non-faulting*
invariant loads result in the same value.  The MI notion of invariant
load guarantees that the load can be legally moved to any location
within its containing function.  The MI notion of invariant_load is
stronger than the IR notion of invariant_load -- an MI invariant_load is
an IR invariant_load + a guarantee that the location being loaded from
is dereferenceable throughout the function's lifetime.

Reviewers: hfinkel, reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10075

llvm-svn: 238881
2015-06-02 22:33:30 +00:00

25 lines
443 B
LLVM

; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
declare void @free_v()
define void @f(i32* %x, i32 %c32, i32* %y) {
; CHECK-LABEL: f
entry:
%v = load i32, i32* %x, !invariant.load !0
; CHECK: movl (%rdi), %ebx
; CHECK: free_v
; CHECK-NOT: movl (%rdi), %ebx
call void @free_v()
%c = icmp ne i32 %c32, 0
br i1 %c, label %left, label %merge
left:
store i32 %v, i32* %y
br label %merge
merge:
ret void
}
!0 = !{}