From de8c7d8ae2226e440c7294f5122a02021cd3a9c1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 4 Mar 2006 01:19:34 +0000 Subject: [PATCH] add a note llvm-svn: 26513 --- lib/Target/README.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 1ab1f16c71a..2ce2575d1ca 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -86,3 +86,18 @@ int f(int a, int b){ return a * a + 2 * a * b + b * b; } into: int f(int a, int b) { return a * (a + 2 * b) + b * b; } 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. +