diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-24 00:09:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-24 00:09:49 +0000 |
commit | abb992d6a3d2dc05d3f3c62a367ea8977a7dd070 (patch) | |
tree | b2498eacd1dbdae0230b2b4037063bca999a4ea9 /lib/Target/PowerPC/README.txt | |
parent | eb38ebf15c326a5bb45ca9da6329cdf19ad6df95 (diff) |
change the canonical form of "cond ? -1 : 0" to be
"sext cond" instead of a select. This simplifies some instcombine
code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows
us to generate better code for a testcase on ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/README.txt')
-rw-r--r-- | lib/Target/PowerPC/README.txt | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt index a243543cd4..5af108ac68 100644 --- a/lib/Target/PowerPC/README.txt +++ b/lib/Target/PowerPC/README.txt @@ -640,22 +640,19 @@ 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] + %neg = sext i1 %0 to i32 ; <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 + cntlzw r2, r3 + slwi r2, r2, 26 + srawi r3, r2, 31 blr -it would be much better to produce: +it would be better to produce: _bar: addic r3,r3,-1 |