The GEP aliasing code currently checks for the GEP decomposition limit being reached (i.e., we did not reach the "final" underlying object). As far as I can see, these checks are not necessary. It is perfectly fine to work with a GEP whose base can still be further decomposed. Looking back through the commit history, these checks were originally introduced in1a444489e9. However, I believe that the problem this was intended to address was later properly fixed with1726fc698c, and the checks are no longer necessary since then (and were not the right fix in the first place). Differential Revision: https://reviews.llvm.org/D91010
32 lines
1.2 KiB
LLVM
32 lines
1.2 KiB
LLVM
; RUN: opt -S -basic-aa -aa-eval -print-all-alias-modref-info -disable-output < %s 2>&1 | FileCheck %s
|
|
|
|
; CHECK-LABEL: Function: test
|
|
;; Before limit:
|
|
; CHECK-DAG: MustAlias: i8* %gep.add5, i8* %gep.inc5
|
|
; CHECK-DAG: NoAlias: i8* %gep.inc3, i8* %gep.inc5
|
|
; CHECK-DAG: NoAlias: i8* %gep.inc4, i8* %gep.inc5
|
|
;; At limit:
|
|
; CHECK-DAG: MustAlias: i8* %gep.add6, i8* %gep.inc6
|
|
; CHECK-DAG: NoAlias: i8* %gep.inc4, i8* %gep.inc6
|
|
; CHECK-DAG: NoAlias: i8* %gep.inc5, i8* %gep.inc6
|
|
;; After limit:
|
|
; CHECK-DAG: MayAlias: i8* %gep.add7, i8* %gep.inc7
|
|
; CHECK-DAG: MayAlias: i8* %gep.inc5, i8* %gep.inc7
|
|
; CHECK-DAG: NoAlias: i8* %gep.inc6, i8* %gep.inc7
|
|
|
|
define void @test(i8* %base) {
|
|
%gep.add5 = getelementptr i8, i8* %base, i64 5
|
|
%gep.add6 = getelementptr i8, i8* %base, i64 6
|
|
%gep.add7 = getelementptr i8, i8* %base, i64 7
|
|
|
|
%gep.inc1 = getelementptr i8, i8* %base, i64 1
|
|
%gep.inc2 = getelementptr i8, i8* %gep.inc1, i64 1
|
|
%gep.inc3 = getelementptr i8, i8* %gep.inc2, i64 1
|
|
%gep.inc4 = getelementptr i8, i8* %gep.inc3, i64 1
|
|
%gep.inc5 = getelementptr i8, i8* %gep.inc4, i64 1
|
|
%gep.inc6 = getelementptr i8, i8* %gep.inc5, i64 1
|
|
%gep.inc7 = getelementptr i8, i8* %gep.inc6, i64 1
|
|
|
|
ret void
|
|
}
|