diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-31 19:49:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-31 19:49:20 +0000 |
commit | 95b9d6e5d8f35ccefccea0680ed733e752ff7d65 (patch) | |
tree | fa8504bbe765f033e723e4db4d1340c3ec18403d | |
parent | 6ffbe17b3c7934dd97bbbd97c77526727b7ac5d7 (diff) |
A relatively simple PPC optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33709 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/README.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt index 1c3e204d9d..2114fde89a 100644 --- a/lib/Target/PowerPC/README.txt +++ b/lib/Target/PowerPC/README.txt @@ -595,3 +595,30 @@ register of that class. If it is then later necessary to spill that reg, so be it. ===-------------------------------------------------------------------------=== + +We compile this: +int test(_Bool X) { + return X ? 524288 : 0; +} + +to: +_test: + cmplwi cr0, r3, 0 + lis r2, 8 + li r3, 0 + beq cr0, LBB1_2 ;entry +LBB1_1: ;entry + mr r3, r2 +LBB1_2: ;entry + blr + +instead of: +_test: + addic r2,r3,-1 + subfe r0,r2,r3 + slwi r3,r0,19 + blr + +This sort of thing occurs a lot due to globalopt. + +===-------------------------------------------------------------------------=== |