llvm-6502/lib/Transforms
Benjamin Kramer 1db071f0da Teach instcombine to transform
(X >s -1) ? C1 : C2 and (X <s  0) ? C2 : C1
into ((X >>s 31) & (C2 - C1)) + C1, avoiding the conditional.

This optimization could be extended to take non-const C1 and C2 but we better
stay conservative to avoid code size bloat for now.

for
int sel(int n) {
     return n >= 0 ? 60 : 100;
}

we now generate
  sarl  $31, %edi
  andl  $40, %edi
  leal  60(%rdi), %eax

instead of
  testl %edi, %edi
  movl  $60, %ecx
  movl  $100, %eax
  cmovnsl %ecx, %eax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 11:39:10 +00:00
..
Hello Add an exports file for the Hello example plugin. 2010-06-24 17:36:51 +00:00
InstCombine Teach instcombine to transform 2010-07-08 11:39:10 +00:00
Instrumentation use setArgOperand 2010-06-28 12:31:35 +00:00
IPO Rename "Release" builds as "Release+Asserts"; rename "Release-Asserts" 2010-07-07 07:48:00 +00:00
Scalar Fix the second half of PR7437: scalarrepl wasn't preserving 2010-07-08 00:27:05 +00:00
Utils MDString is already checked earlier. 2010-07-02 21:13:23 +00:00
Makefile Revert r100896 and around - this breaks the only mingw32 buildbot we have. 2010-04-15 19:51:42 +00:00