Skip to content

Commit d0bdf3e

Browse files
committedJun 13, 2016
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 llvm-svn: 272580
1 parent 9964687 commit d0bdf3e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
 

‎llvm/lib/Analysis/AliasAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ ModRefInfo AAResults::callCapturesBefore(const Instruction *I,
445445

446446
unsigned ArgNo = 0;
447447
ModRefInfo R = MRI_NoModRef;
448-
for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
448+
for (auto CI = CS.data_operands_begin(), CE = CS.data_operands_end();
449449
CI != CE; ++CI, ++ArgNo) {
450450
// Only look at the no-capture or byval pointer arguments. If this
451451
// pointer were passed to arguments that were neither of these, then it
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; RUN: opt -S -dse < %s | FileCheck %s
2+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3+
target triple = "x86_64-unknown-linux-gnu"
4+
5+
define void @f() {
6+
; CHECK-LABEL: @f(
7+
%s = alloca i64
8+
; Verify that this first store is not considered killed by the second one
9+
; since it could be observed from the deopt continuation.
10+
; CHECK: store i64 1, i64* %s
11+
store i64 1, i64* %s
12+
call void @g() [ "deopt"(i64* %s) ]
13+
store i64 0, i64* %s
14+
ret void
15+
}
16+
17+
declare void @g()

0 commit comments

Comments
 (0)
Please sign in to comment.