[llvm] r272580 - Fix AAResults::callCapturesBefore for operand bundles

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 12:55:05 PDT 2016


Author: sanjoy
Date: Mon Jun 13 14:55:04 2016
New Revision: 272580

URL: http://llvm.org/viewvc/llvm-project?rev=272580&view=rev
Log:
Fix AAResults::callCapturesBefore for operand bundles

Summary:
AAResults::callCapturesBefore would previously ignore operand
bundles. It was possible for a later instruction to miss its memory
dependency on a call site that would only access the pointer through a
bundle.

Patch by Oscar Blumberg!

Reviewers: sanjoy

Differential Revision: http://reviews.llvm.org/D21286

Added:
    llvm/trunk/test/CodeGen/X86/statepoint-memdep.ll
Modified:
    llvm/trunk/lib/Analysis/AliasAnalysis.cpp

Modified: llvm/trunk/lib/Analysis/AliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysis.cpp?rev=272580&r1=272579&r2=272580&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysis.cpp Mon Jun 13 14:55:04 2016
@@ -445,7 +445,7 @@ ModRefInfo AAResults::callCapturesBefore
 
   unsigned ArgNo = 0;
   ModRefInfo R = MRI_NoModRef;
-  for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
+  for (auto CI = CS.data_operands_begin(), CE = CS.data_operands_end();
        CI != CE; ++CI, ++ArgNo) {
     // Only look at the no-capture or byval pointer arguments.  If this
     // pointer were passed to arguments that were neither of these, then it

Added: llvm/trunk/test/CodeGen/X86/statepoint-memdep.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/statepoint-memdep.ll?rev=272580&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/statepoint-memdep.ll (added)
+++ llvm/trunk/test/CodeGen/X86/statepoint-memdep.ll Mon Jun 13 14:55:04 2016
@@ -0,0 +1,17 @@
+; RUN: opt -S -dse < %s | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @f() {
+  ; CHECK-LABEL: @f(
+  %s = alloca i64
+  ; Verify that this first store is not considered killed by the second one
+  ; since it could be observed from the deopt continuation.
+  ; CHECK: store i64 1, i64* %s
+  store i64 1, i64* %s
+  call void @g() [ "deopt"(i64* %s) ]
+  store i64 0, i64* %s
+  ret void
+}
+
+declare void @g()




More information about the llvm-commits mailing list