[PATCH] D42381: [DA] Correct size parameter from dependency analysis to AA

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 05:56:23 PDT 2018


dmgreen updated this revision to Diff 141139.

https://reviews.llvm.org/D42381

Files:
  lib/Analysis/DependenceAnalysis.cpp
  test/Analysis/DependenceAnalysis/AASize.ll


Index: test/Analysis/DependenceAnalysis/AASize.ll
===================================================================
--- /dev/null
+++ test/Analysis/DependenceAnalysis/AASize.ll
@@ -0,0 +1,19 @@
+; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
+
+; CHECK-LABEL: test
+; CHECK: da analyze - none!
+; CHECK: da analyze - confused!
+; CHECK: da analyze - none!
+; CHECK: da analyze - none!
+; CHECK: da analyze - confused!
+; CHECK: da analyze - none!
+
+ at a = global i16 5, align 2
+ at b = global i16* @a, align 4
+define void @test2() {
+entry:
+  %0 = load i16*, i16** @b, align 4
+  %1 = load i16, i16* %0, align 2
+  store i16 1, i16* @a, align 2
+  ret void
+}
Index: lib/Analysis/DependenceAnalysis.cpp
===================================================================
--- lib/Analysis/DependenceAnalysis.cpp
+++ lib/Analysis/DependenceAnalysis.cpp
@@ -626,8 +626,12 @@
                                           const Value *B) {
   const Value *AObj = GetUnderlyingObject(A, DL);
   const Value *BObj = GetUnderlyingObject(B, DL);
-  return AA->alias(AObj, DL.getTypeStoreSize(AObj->getType()),
-                   BObj, DL.getTypeStoreSize(BObj->getType()));
+
+  if(AObj == BObj)
+    return MustAlias;
+  if (!isIdentifiedObject(AObj) || !isIdentifiedObject(BObj))
+    return MayAlias;
+  return NoAlias;
 }
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42381.141139.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180405/d550eaec/attachment.bin>


More information about the llvm-commits mailing list