[llvm-commits] [llvm] r94350 - /llvm/trunk/lib/Target/PowerPC/README.txt
Chris Lattner
sabre at nondot.org
Sat Jan 23 18:27:03 PST 2010
Author: lattner
Date: Sat Jan 23 20:27:03 2010
New Revision: 94350
URL: http://llvm.org/viewvc/llvm-project?rev=94350&view=rev
Log:
move PR5945 here.
Modified:
llvm/trunk/lib/Target/PowerPC/README.txt
Modified: llvm/trunk/lib/Target/PowerPC/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/README.txt?rev=94350&r1=94349&r2=94350&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/README.txt (original)
+++ llvm/trunk/lib/Target/PowerPC/README.txt Sat Jan 23 20:27:03 2010
@@ -430,6 +430,35 @@
===-------------------------------------------------------------------------===
+PR5945: This:
+define i32 @clamp0g(i32 %a) {
+entry:
+ %cmp = icmp slt i32 %a, 0
+ %sel = select i1 %cmp, i32 0, i32 %a
+ ret i32 %sel
+}
+
+Is compile to this with the PowerPC (32-bit) backend:
+
+_clamp0g:
+ cmpwi cr0, r3, 0
+ li r2, 0
+ blt cr0, LBB1_2
+; BB#1: ; %entry
+ mr r2, r3
+LBB1_2: ; %entry
+ mr r3, r2
+ blr
+
+This could be reduced to the much simpler:
+
+_clamp0g:
+ srawi r2, r3, 31
+ andc r3, r3, r2
+ blr
+
+===-------------------------------------------------------------------------===
+
int foo(int N, int ***W, int **TK, int X) {
int t, i;
More information about the llvm-commits
mailing list