mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
add a note
llvm-svn: 26513
This commit is contained in:
parent
f2a0107221
commit
de8c7d8ae2
@ -86,3 +86,18 @@ int f(int a, int b){ return a * a + 2 * a * b + b * b; }
|
|||||||
into:
|
into:
|
||||||
int f(int a, int b) { return a * (a + 2 * b) + b * b; }
|
int f(int a, int b) { return a * (a + 2 * b) + b * b; }
|
||||||
to eliminate a multiply.
|
to eliminate a multiply.
|
||||||
|
|
||||||
|
//===---------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
On targets with expensive 64-bit multiply, we could LSR this:
|
||||||
|
|
||||||
|
for (i = ...; ++i) {
|
||||||
|
x = 1ULL << i;
|
||||||
|
|
||||||
|
into:
|
||||||
|
long long tmp = 1;
|
||||||
|
for (i = ...; ++i, tmp+=tmp)
|
||||||
|
x = tmp;
|
||||||
|
|
||||||
|
This would be a win on ppc32, but not x86 or ppc64.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user