Eli Friedman ebec984e14 [AliasAnalysis] Misc fixes for checking aliasing with scalable types.
This is fixing up various places that use the implicit
TypeSize->uint64_t conversion.

The new overloads in MemoryLocation.h are already used in various places
that construct a MemoryLocation from a TypeSize, including MemorySSA.
(They were using the implicit conversion before.)

Differential Revision: https://reviews.llvm.org/D76249
2020-03-18 12:28:47 -07:00

26 lines
960 B
LLVM

; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa -disable-output < %s 2>&1 | FileCheck %s
; CHECK-LABEL: define <vscale x 4 x i32> @f(
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK: MemoryUse(1) MustAlias
define <vscale x 4 x i32> @f(<vscale x 4 x i32> %z) {
%a = alloca <vscale x 4 x i32>
store <vscale x 4 x i32> %z, <vscale x 4 x i32>* %a
%zz = load <vscale x 4 x i32>, <vscale x 4 x i32>* %a
ret <vscale x 4 x i32> %zz
}
; CHECK-LABEL: define i32 @g(
; CHECK: 1 = MemoryDef(liveOnEntry)
; CHECK: MemoryUse(1) MayAlias
declare i32* @gg(<vscale x 4 x i32>* %a)
define i32 @g(i32 %z, i32 *%bb) {
%a = alloca <vscale x 4 x i32>
%aa = getelementptr <vscale x 4 x i32>, <vscale x 4 x i32>* %a, i32 0, i32 0
store i32 %z, i32* %aa
%bbb = call i32* @gg(<vscale x 4 x i32>* %a) readnone
%zz = load i32, i32* %bbb
ret i32 %zz
}