mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Support zero size types in StackSafetyAnalysis.
Reviewers: vitalybuka Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73395
This commit is contained in:
parent
a55605a524
commit
d2f0ede221
@ -252,6 +252,10 @@ StackSafetyLocalAnalysis::offsetFromAlloca(Value *Addr,
|
||||
ConstantRange
|
||||
StackSafetyLocalAnalysis::getAccessRange(Value *Addr, const Value *AllocaPtr,
|
||||
ConstantRange SizeRange) {
|
||||
// Zero-size loads and stores do not access memory.
|
||||
if (SizeRange.isEmptySet())
|
||||
return ConstantRange::getEmpty(PointerSize);
|
||||
|
||||
if (!SE.isSCEVable(Addr->getType()))
|
||||
return UnknownRange;
|
||||
|
||||
|
@ -368,3 +368,20 @@ entry:
|
||||
store <vscale x 4 x i32> %v, <vscale x 4 x i32>* %p, align 4
|
||||
ret void
|
||||
}
|
||||
|
||||
%zerosize_type = type {}
|
||||
|
||||
define void @ZeroSize(%zerosize_type *%p) {
|
||||
; CHECK-LABEL: @ZeroSize dso_preemptable{{$}}
|
||||
; CHECK-NEXT: args uses:
|
||||
; CHECK-NEXT: p[]: empty-set
|
||||
; CHECK-NEXT: allocas uses:
|
||||
; CHECK-NEXT: x[0]: empty-set
|
||||
; CHECK-NOT: ]:
|
||||
entry:
|
||||
%x = alloca %zerosize_type, align 4
|
||||
store %zerosize_type undef, %zerosize_type* %x, align 4
|
||||
store %zerosize_type undef, %zerosize_type* undef, align 4
|
||||
%val = load %zerosize_type, %zerosize_type* %p, align 4
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user