add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94317 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-01-23 18:42:37 +00:00
parent aa306c2cc1
commit a9cf5b3cc9

View File

@ -635,6 +635,35 @@ This sort of thing occurs a lot due to globalopt.
===-------------------------------------------------------------------------===
We compile:
define i32 @bar(i32 %x) nounwind readnone ssp {
entry:
%0 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
%neg = select i1 %0, i32 -1, i32 0 ; <i32> [#uses=1]
ret i32 %neg
}
to:
_bar:
cmplwi cr0, r3, 0
li r3, -1
beq cr0, LBB1_2
; BB#1: ; %entry
li r3, 0
LBB1_2: ; %entry
blr
it would be much better to produce:
_bar:
addic r3,r3,-1
subfe r3,r3,r3
blr
===-------------------------------------------------------------------------===
We currently compile 32-bit bswap:
declare i32 @llvm.bswap.i32(i32 %A)