Hopefully fixed by http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20071217/056446.html

This is my first attempt hacking on Transforms, so some of the idioms were a little new to me. Hope the patch looks OK! =)

On Dec 17, 2007, at 5:19 PM, Chris Lattner wrote:

Author: lattner
Date: Mon Dec 17 19:19:18 2007
New Revision: 45141

URL: http://llvm.org/viewvc/llvm-project?rev=45141&view=rev
Log:
add a missed case.

Modified:
    llvm/trunk/lib/Target/README.txt

Modified: llvm/trunk/lib/Target/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ README.txt?rev=45141&r1=45140&r2=45141&view=diff

====================================================================== ========
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Mon Dec 17 19:19:18 2007
@@ -464,3 +464,21 @@
 }

// ===------------------------------------------------------------------- --===//
+
+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.
+
+// ===------------------------------------------------------------------- --===//


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

--
Christopher Lamb



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to