Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
[oota-llvm.git] / test / Analysis / LoadVN / call_pure_function.ll
1 ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
2
3 declare i32 @strlen(i8*) readonly
4
5 declare void @use(i32)
6
7 define i8 @test(i8* %P, i8* %Q) {
8         %A = load i8* %Q                ; <i8> [#uses=1]
9         %X = call i32 @strlen( i8* %P ) readonly                ; <i32> [#uses=1]
10         %B = load i8* %Q                ; <i8> [#uses=1]
11         call void @use( i32 %X )
12         %C = sub i8 %A, %B              ; <i8> [#uses=1]
13         ret i8 %C
14 }