[PATCH] D61669: [ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 8 02:53:54 PDT 2019
fhahn updated this revision to Diff 198611.
fhahn added a comment.
Add missing attributes to @init argument.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61669/new/
https://reviews.llvm.org/D61669
Files:
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Analysis/BasicAA/ptrmask.ll
Index: llvm/test/Analysis/BasicAA/ptrmask.ll
===================================================================
--- /dev/null
+++ llvm/test/Analysis/BasicAA/ptrmask.ll
@@ -0,0 +1,25 @@
+; RUN: opt -basicaa -aa-eval -print-no-aliases -disable-output %s 2>&1 | FileCheck %s
+
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128-p0:48:64:128-p1:56:64:64"
+
+%struct = type <{ [20 x i64] }>
+
+; CHECK-LABEL: Function: test1: 5 pointers, 2 call sites
+; CHECK-NEXT: NoAlias: %struct** %loc, i64* %offset.addr
+; CHECK-NEXT: NoAlias: %struct* %addr, %struct** %loc
+; CHECK-NEXT: NoAlias: %struct* %addr.ptr, %struct** %loc
+; CHECK-NEXT: NoAlias: %struct** %loc, i64* %gep
+define void @test1(i64* %offset.addr) {
+entry:
+ %loc = alloca %struct*, align 8
+ call void @init(i64 0, %struct** nocapture nonnull %loc)
+ %addr = load %struct*, %struct** %loc, align 8
+ %addr.ptr = call %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct* %addr, i64 72057594037927928)
+ %offset = load i64, i64* %offset.addr, align 8
+ %gep = getelementptr inbounds %struct, %struct* %addr.ptr, i64 0, i32 0, i64 %offset
+ store i64 1, i64* %gep, align 8
+ ret void
+}
+
+declare %struct* @llvm.ptrmask.p0s_struct.p0s.struct.i64(%struct*, i64)
+declare void @init(i64, %struct**)
Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -3697,7 +3697,8 @@
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::ptrmask;
}
/// \p PN defines a loop-variant pointer to an object. Check if the
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61669.198611.patch
Type: text/x-patch
Size: 1952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190508/f6e325e5/attachment.bin>
More information about the llvm-commits
mailing list