diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-24 02:27:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-24 02:27:03 +0000 |
| commit | e0359b4fe7c6a10c3f549ce013f90ae1419b1ac2 (patch) | |
| tree | 67ec333147ca1012d1b06c7a41bf808b6432c2cf /llvm/lib | |
| parent | 74716e5ebdd30caf6eac0ec68f2a91e1b3920a87 (diff) | |
| download | bcm5719-llvm-e0359b4fe7c6a10c3f549ce013f90ae1419b1ac2.tar.gz bcm5719-llvm-e0359b4fe7c6a10c3f549ce013f90ae1419b1ac2.zip | |
move PR5945 here.
llvm-svn: 94350
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/PowerPC/README.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/README.txt b/llvm/lib/Target/PowerPC/README.txt index 5af108ac683..8f265cfc488 100644 --- a/llvm/lib/Target/PowerPC/README.txt +++ b/llvm/lib/Target/PowerPC/README.txt @@ -430,6 +430,35 @@ This theoretically may help improve twolf slightly (used in dimbox.c:142?). ===-------------------------------------------------------------------------=== +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; |

