1 ; This testcase makes sure that size is taken to account when alias analysis
2 ; is performed. It is not legal to delete the second load instruction because
3 ; the value computed by the first load instruction is changed by the store.
5 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn,instcombine -S | FileCheck %s
8 ; CHECK: %Y.DONOTREMOVE = load i32, ptr %A
9 ; CHECK: %Z = sub i32 0, %Y.DONOTREMOVE
13 %C = getelementptr i8, ptr %A, i64 1
14 store i8 1, ptr %C ; Aliases %A
15 %Y.DONOTREMOVE = load i32, ptr %A
16 %Z = sub i32 %X, %Y.DONOTREMOVE