diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-18 01:19:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-18 01:19:18 +0000 |
commit | fd2025e9db2bd132c5322d0fdfdad0386b8a31c6 (patch) | |
tree | 23a38bd0efcb7602b2d57bbda01f89ae36122b37 | |
parent | a5cecd0a130f7ebc4787f8f5b3e8959e41786673 (diff) |
add a missed case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45141 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 37c0a359a2..c942d94471 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -464,3 +464,21 @@ entry: } //===---------------------------------------------------------------------===// + +This code is often produced by the SMAX expansion in SCEV: + +define i32 @foo(i32 %a) { +entry: + %tmp15 = sub i32 99, %a ; <i32> [#uses=2] + %tmp16 = icmp slt i32 %tmp15, 0 ; <i1> [#uses=1] + %smax = select i1 %tmp16, i32 0, i32 %tmp15 ; <i32> [#uses=1] + %tmp12 = add i32 %smax, %a ; <i32> [#uses=1] + %tmp13 = add i32 %tmp12, 1 ; <i32> [#uses=1] + ret i32 %tmp13 +} + +Note that the tmp12 add can be pushed through the select operands, turning +it into a "select %tmp16, %a, 99". We apparently already do this in dag +combine because it isn't present in X86 output. + +//===---------------------------------------------------------------------===// |