1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Make sure that pure calls don't kill loads

llvm-svn: 12416
This commit is contained in:
Chris Lattner 2004-03-15 04:17:53 +00:00
parent 8a82176edc
commit e48c972a67

View File

@ -0,0 +1,13 @@
; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub
declare int %strlen(sbyte*)
declare void %use(int %X)
sbyte %test(sbyte* %P, sbyte* %Q) {
%A = load sbyte* %Q
%X = call int %strlen(sbyte* %P)
%B = load sbyte* %Q ;; CSE with A.
call void %use(int %X) ;; make strlen not dead
%C = sub sbyte %A, %B
ret sbyte %C
}