llvm.org GIT mirror llvm / 86f53ba
[BasicAA] Fix for missing must alias (D16343) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259299 91177308-0d34-0410-b5e6-96231b3b80d8 Gerolf Hoflehner 4 years ago
2 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
464464 }
465465 }
466466
467 // Take care of wrap-arounds
468 BaseOffs = adjustToPointerSize(BaseOffs, PointerSize);
469
467470 // Analyze the base pointer next.
468471 V = GEPOp->getOperand(0);
469472 } while (--MaxLookup);
0 ; RUN: opt -S -basicaa -gvn < %s | FileCheck %s
1
2 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
3 target triple = "i386-apple-macosx10.6.0"
4
5 ; We incorrectly returned noalias in the example below for "tmp5" and
6 ; "tmp12" returning i32 32, since basicaa converted the offsets to 64b
7 ; and missed the wrap-around
8
9 define i32 @foo(i8* %buffer) {
10 entry:
11 %tmp2 = getelementptr i8, i8* %buffer, i32 -2071408432
12 %tmp3 = bitcast i8* %tmp2 to i32*
13 %tmp4 = getelementptr i8, i8* %buffer, i32 128
14 %tmp5 = bitcast i8* %tmp4 to i32*
15 store i32 32, i32* %tmp5, align 4
16 %tmp12 = getelementptr i32, i32* %tmp3, i32 -1629631508
17 store i32 28, i32* %tmp12, align 4
18 %tmp13 = getelementptr i8, i8* %buffer, i32 128
19 %tmp14 = bitcast i8* %tmp13 to i32*
20 %tmp2083 = load i32, i32* %tmp14, align 4
21 ; CHECK: ret i32 28
22 ret i32 %tmp2083
23 }