From 88990248d3bfb2f265fcf27f8a032ac0eb14d09f Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 14 Nov 2011 22:49:42 +0000 Subject: Refactor capture tracking (which already had a couple flags for whether returns and stores capture) to permit the caller to see each capture point and decide whether to continue looking. Use this inside memdep to do an analysis that basicaa won't do. This lets us solve another devirtualization case, fixing PR8908! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144580 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/GVN/rle.ll | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/Transforms/GVN') diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index 2f0d2eb367..47ccd85d48 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -642,3 +642,28 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind +;;===----------------------------------------------------------------------===;; +;; Load -> Store dependency which isn't interfered with by a call that happens +;; before the pointer was captured. +;;===----------------------------------------------------------------------===;; + +%class.X = type { [8 x i8] } + +@_ZTV1X = weak_odr constant [5 x i8*] zeroinitializer +@_ZTV1Y = weak_odr constant [5 x i8*] zeroinitializer + +declare void @use() +declare void @use3(i8***, i8**) + +; PR8908 +define void @test_escape1() nounwind { + %x = alloca i8**, align 8 + store i8** getelementptr inbounds ([5 x i8*]* @_ZTV1X, i64 0, i64 2), i8*** %x, align 8 + call void @use() nounwind + %DEAD = load i8*** %x, align 8 + call void @use3(i8*** %x, i8** %DEAD) nounwind + ret void +; CHECK: test_escape1 +; CHECK-NOT: DEAD +; CHECK: ret +} -- cgit v1.2.3