mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-31 09:32:11 +00:00
Revert r121520, which may have introduced miscompilations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121573 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0be099da79
commit
839c092548
@ -857,17 +857,6 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
|
|||||||
if (GEP1BaseOffset == 0 && GEP1VariableIndices.empty())
|
if (GEP1BaseOffset == 0 && GEP1VariableIndices.empty())
|
||||||
return MustAlias;
|
return MustAlias;
|
||||||
|
|
||||||
// If there is a difference betwen the pointers, but the difference is
|
|
||||||
// less than the size of the associated memory object, then we know
|
|
||||||
// that the objects are partially overlapping.
|
|
||||||
if (GEP1BaseOffset != 0 && GEP1VariableIndices.empty()) {
|
|
||||||
if (GEP1BaseOffset >= 0 ?
|
|
||||||
(V2Size != UnknownSize && (uint64_t)GEP1BaseOffset < V2Size) :
|
|
||||||
(V1Size != UnknownSize && -(uint64_t)GEP1BaseOffset < V1Size &&
|
|
||||||
GEP1BaseOffset != INT64_MIN))
|
|
||||||
return PartialAlias;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have a known constant offset, see if this offset is larger than the
|
// If we have a known constant offset, see if this offset is larger than the
|
||||||
// access size being queried. If so, and if no variable indices can remove
|
// access size being queried. If so, and if no variable indices can remove
|
||||||
// pieces of this constant, then we know we have a no-alias. For example,
|
// pieces of this constant, then we know we have a no-alias. For example,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
; RUN: opt -enable-tbaa -basicaa -tbaa -gvn -instcombine -S < %s | FileCheck %s --check-prefix=TBAA
|
; RUN: opt -enable-tbaa -basicaa -tbaa -gvn -instcombine -S < %s | grep {ret i32 0}
|
||||||
; RUN: opt -enable-tbaa -tbaa -basicaa -gvn -instcombine -S < %s | FileCheck %s --check-prefix=BASICAA
|
; RUN: opt -enable-tbaa -tbaa -basicaa -gvn -instcombine -S < %s | grep {ret i32 1075000115}
|
||||||
|
|
||||||
; According to the TBAA metadata the load and store don't alias. However,
|
; According to the TBAA metadata the load and store don't alias. However,
|
||||||
; according to the actual code, they do. The order of the alias analysis
|
; according to the actual code, they do. The order of the alias analysis
|
||||||
@ -7,12 +7,6 @@
|
|||||||
|
|
||||||
target datalayout = "e-p:64:64:64"
|
target datalayout = "e-p:64:64:64"
|
||||||
|
|
||||||
; Test for simple MustAlias aliasing.
|
|
||||||
|
|
||||||
; TBAA: @trouble
|
|
||||||
; TBAA: ret i32 0
|
|
||||||
; BASICAA: @trouble
|
|
||||||
; BASICAA: ret i32 1075000115
|
|
||||||
define i32 @trouble(i32* %x) nounwind {
|
define i32 @trouble(i32* %x) nounwind {
|
||||||
entry:
|
entry:
|
||||||
store i32 0, i32* %x, !tbaa !0
|
store i32 0, i32* %x, !tbaa !0
|
||||||
@ -22,25 +16,6 @@ entry:
|
|||||||
ret i32 %tmp3
|
ret i32 %tmp3
|
||||||
}
|
}
|
||||||
|
|
||||||
; Test for PartialAlias aliasing. GVN doesn't yet eliminate the load
|
|
||||||
; in the BasicAA case.
|
|
||||||
|
|
||||||
; TBAA: @offset
|
|
||||||
; TBAA: ret i64 0
|
|
||||||
; BASICAA: @offset
|
|
||||||
; BASICAA: ret i64 %tmp3
|
|
||||||
define i64 @offset(i64* %x) nounwind {
|
|
||||||
entry:
|
|
||||||
store i64 0, i64* %x, !tbaa !4
|
|
||||||
%0 = bitcast i64* %x to i8*
|
|
||||||
%1 = getelementptr i8* %0, i64 1
|
|
||||||
store i8 1, i8* %1, !tbaa !5
|
|
||||||
%tmp3 = load i64* %x, !tbaa !4
|
|
||||||
ret i64 %tmp3
|
|
||||||
}
|
|
||||||
|
|
||||||
!0 = metadata !{metadata !"int", metadata !1}
|
!0 = metadata !{metadata !"int", metadata !1}
|
||||||
!1 = metadata !{metadata !"simple"}
|
!1 = metadata !{metadata !"simple"}
|
||||||
!3 = metadata !{metadata !"float", metadata !1}
|
!3 = metadata !{metadata !"float", metadata !1}
|
||||||
!4 = metadata !{metadata !"long", metadata !1}
|
|
||||||
!5 = metadata !{metadata !"small", metadata !1}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user