1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Analysis/BasicAA/gep-decomposition-limit.ll
Nikita Popov 86a2a999fb [BasicAA] Remove checks for GEP decomposition limit reached
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 in 1a444489e9d90915cfdda0720489893896ef1503. However, I
believe that the problem this was intended to address was later
properly fixed with 1726fc698ccb85fe4bb23c200a50f28b57fc53cb, 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
2020-11-12 20:43:38 +01:00

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
}