[llvm] r365079 - Teach ValueTracking that aarch64.irg result aliases its input.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 13:19:14 PDT 2019


Author: eugenis
Date: Wed Jul  3 13:19:14 2019
New Revision: 365079

URL: http://llvm.org/viewvc/llvm-project?rev=365079&view=rev
Log:
Teach ValueTracking that aarch64.irg result aliases its input.

Reviewers: javed.absar, olista01

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64103

Added:
    llvm/trunk/test/Analysis/ValueTracking/aarch64.irg.ll
Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=365079&r1=365078&r2=365079&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Wed Jul  3 13:19:14 2019
@@ -3697,7 +3697,8 @@ const Value *llvm::getArgumentAliasingTo
 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

Added: llvm/trunk/test/Analysis/ValueTracking/aarch64.irg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ValueTracking/aarch64.irg.ll?rev=365079&view=auto
==============================================================================
--- llvm/trunk/test/Analysis/ValueTracking/aarch64.irg.ll (added)
+++ llvm/trunk/test/Analysis/ValueTracking/aarch64.irg.ll Wed Jul  3 13:19:14 2019
@@ -0,0 +1,18 @@
+; 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*)




More information about the llvm-commits mailing list