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:
parent
8a82176edc
commit
e48c972a67
13
test/Regression/Transforms/GCSE/call_pure_function.ll
Normal file
13
test/Regression/Transforms/GCSE/call_pure_function.ll
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user