forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate nonnull and dereferenceable throught launder
Summary: invariant.group.launder should not stop propagation of nonnull and dereferenceable, because e.g. we would not be able to hoist loads speculatively. Reviewers: rsmith, amharc, kuhar, xbolva00, hfinkel Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D46972 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332788 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; RUN: opt -S -instsimplify -instcombine < %s | FileCheck %s | ||
|
||
; CHECK-LABEL: define void @checkNonnull() | ||
define void @checkNonnull() { | ||
; CHECK: %p = call i8* @llvm.launder.invariant.group.p0i8(i8* nonnull %0) | ||
; CHECK: %p2 = call i8* @llvm.launder.invariant.group.p0i8(i8* nonnull %p) | ||
; CHECK: call void @use(i8* nonnull %p2) | ||
entry: | ||
%0 = alloca i8, align 8 | ||
|
||
%p = call i8* @llvm.launder.invariant.group.p0i8(i8* %0) | ||
%p2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %p) | ||
call void @use(i8* %p2) | ||
|
||
ret void | ||
} | ||
|
||
declare i8* @llvm.launder.invariant.group.p0i8(i8*) | ||
declare void @use(i8*) |