1 ; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
3 ; The input *.ll is obtained by manually annotating "invariant.load" to the
4 ; two loads. With "invariant.load" metadata, the second load is redundant.
6 ; int foo(int *p, char *q) {
11 define i32 @foo(i32* nocapture %p, i8* nocapture %q) {
13 %0 = load i32, i32* %p, align 4, !invariant.load !3
14 %conv = trunc i32 %0 to i8
15 store i8 %conv, i8* %q, align 1
16 %1 = load i32, i32* %p, align 4, !invariant.load !3
17 %add = add nsw i32 %1, 1
21 ; CHECK: %0 = load i32, i32* %p
22 ; CHECK: store i8 %conv, i8* %q,
23 ; CHECK: %add = add nsw i32 %0, 1