[llvm-commits] CVS: llvm/lib/Target/README.txt
Andrew Lenharth
andrewl at lenharth.org
Sun Nov 12 18:41:33 PST 2006
He's been looking at the demo script. I was trying that code out...
Andrew
On 11/12/06, Nick Lewycky <nicholas at mxc.ca> wrote:
>
>
> Changes in directory llvm/lib/Target:
>
> README.txt updated: 1.47 -> 1.48
> ---
> Log message:
>
> Cute example from Chris Lattner.
>
>
> ---
> Diffs of the changes: (+40 -0)
>
> README.txt | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 40 insertions(+)
>
>
> Index: llvm/lib/Target/README.txt
> diff -u llvm/lib/Target/README.txt:1.47 llvm/lib/Target/README.txt:1.48
> --- llvm/lib/Target/README.txt:1.47 Thu Nov 9 18:23:26 2006
> +++ llvm/lib/Target/README.txt Sun Nov 12 18:23:28 2006
> @@ -360,3 +360,43 @@
> pass.
>
> //===---------------------------------------------------------------------===//
> +
> +-predsimplify should transform this:
> +
> +void bad(unsigned x)
> +{
> + if (x > 4)
> + bar(12);
> + else if (x > 3)
> + bar(523);
> + else if (x > 2)
> + bar(36);
> + else if (x > 1)
> + bar(65);
> + else if (x > 0)
> + bar(45);
> + else
> + bar(367);
> +}
> +
> +into:
> +
> +void good(unsigned x)
> +{
> + if (x == 4)
> + bar(523);
> + else if (x == 3)
> + bar(36);
> + else if (x == 2)
> + bar(65);
> + else if (x == 1)
> + bar(45);
> + else if (x == 0)
> + bar(367);
> + else
> + bar(12);
> +}
> +
> +to enable further optimizations.
> +
> +//===---------------------------------------------------------------------===//
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list