brintos

brintos / llvm-project-archived public Read only

0
0
Text · 645 B · ed97d21 Raw
20 lines · plain
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 because3; the value computed by the first load instruction is changed by the store.4 5; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn,instcombine -S | FileCheck %s6 7define i32 @test() {8; CHECK: %Y.DONOTREMOVE = load i32, ptr %A9; CHECK: %Z = sub i32 0, %Y.DONOTREMOVE10  %A = alloca i3211  store i32 0, ptr %A12  %X = load i32, ptr %A13  %C = getelementptr i8, ptr %A, i64 114  store i8 1, ptr %C    ; Aliases %A15  %Y.DONOTREMOVE = load i32, ptr %A16  %Z = sub i32 %X, %Y.DONOTREMOVE17  ret i32 %Z18}19 20