Reviewers: javed.absar, olista01
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64103
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365079
91177308-0d34-0410-b5e6-
96231b3b80d8
bool llvm::isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
const CallBase *Call) {
return Call->getIntrinsicID() == Intrinsic::launder_invariant_group ||
- Call->getIntrinsicID() == Intrinsic::strip_invariant_group;
+ Call->getIntrinsicID() == Intrinsic::strip_invariant_group ||
+ Call->getIntrinsicID() == Intrinsic::aarch64_irg;
}
/// \p PN defines a loop-variant pointer to an object. Check if the
--- /dev/null
+; RUN: opt -S -instsimplify -instcombine < %s | FileCheck %s
+
+; CHECK-LABEL: define void @checkNonnullIrg()
+define void @checkNonnullIrg() {
+; CHECK: %[[p:.*]] = call i8* @llvm.aarch64.irg(i8* nonnull
+; CHECK: call void @use(i8* nonnull %[[p]])
+entry:
+ %0 = alloca i8, align 16
+
+ %p = call i8* @llvm.aarch64.irg(i8* %0, i64 5)
+ call void @use(i8* %p)
+
+ ret void
+}
+
+declare i8* @llvm.aarch64.irg(i8*, i64)
+
+declare void @use(i8*)