diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index 37c0a359a2b2..c942d9447125 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/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 ; [#uses=2] + %tmp16 = icmp slt i32 %tmp15, 0 ; [#uses=1] + %smax = select i1 %tmp16, i32 0, i32 %tmp15 ; [#uses=1] + %tmp12 = add i32 %smax, %a ; [#uses=1] + %tmp13 = add i32 %tmp12, 1 ; [#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. + +//===---------------------------------------------------------------------===//