From a9cf5b3cc9082acee5b6e30e989a667fed286b05 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 23 Jan 2010 18:42:37 +0000 Subject: [PATCH] add a note git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94317 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/README.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt index 060d6a5c5c2..a243543cd41 100644 --- a/lib/Target/PowerPC/README.txt +++ b/lib/Target/PowerPC/README.txt @@ -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 ; [#uses=1] + %neg = select i1 %0, i32 -1, i32 0 ; [#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)