Benjamin Kramer f50125ecaa DAGCombine add (sext i1), X into sub X, (zext i1) if sext from i1 is illegal. The latter usually compiles into smaller code.
example code:
unsigned foo(unsigned x, unsigned y) {
  if (x != 0) y--;
  return y;
}

before:
  _foo:                           ## @foo
    cmpl  $1, 4(%esp)             ## encoding: [0x83,0x7c,0x24,0x04,0x01]
    sbbl  %eax, %eax              ## encoding: [0x19,0xc0]
    notl  %eax                    ## encoding: [0xf7,0xd0]
    addl  8(%esp), %eax           ## encoding: [0x03,0x44,0x24,0x08]
    ret                           ## encoding: [0xc3]

after:
  _foo:                           ## @foo
    cmpl  $1, 4(%esp)             ## encoding: [0x83,0x7c,0x24,0x04,0x01]
    movl  8(%esp), %eax           ## encoding: [0x8b,0x44,0x24,0x08]
    adcl  $-1, %eax               ## encoding: [0x83,0xd0,0xff]
    ret                           ## encoding: [0xc3]



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 23:17:45 +00:00
..
2010-09-30 23:57:10 +00:00
2010-09-30 23:57:10 +00:00
2010-11-27 20:43:02 +00:00
2010-02-13 02:06:10 +00:00
2010-02-15 22:03:29 +00:00
2010-09-21 20:50:32 +00:00
2010-07-13 18:14:47 +00:00
2010-10-11 21:08:42 +00:00
2010-03-03 00:35:56 +00:00
2010-11-30 09:23:54 +00:00
2010-11-29 22:34:55 +00:00
2010-04-17 16:29:15 +00:00
2010-10-08 05:12:30 +00:00
2010-07-16 22:51:10 +00:00
2010-07-10 22:42:12 +00:00
2010-04-17 03:43:36 +00:00
2010-05-08 04:47:54 +00:00
2010-08-30 18:12:35 +00:00
2010-06-14 20:19:03 +00:00
2010-04-17 16:29:15 +00:00
2010-04-17 16:29:15 +00:00
2010-10-07 20:56:25 +00:00
2010-09-30 23:57:10 +00:00
2010-09-30 23:57:10 +00:00
2010-09-30 23:57:10 +00:00
2010-09-30 23:57:10 +00:00
2010-10-05 21:58:12 +00:00
2010-10-01 05:08:18 +00:00
2010-09-30 23:57:10 +00:00
2010-09-30 23:57:10 +00:00
2010-04-04 19:28:59 +00:00
2010-03-25 20:01:07 +00:00
2010-09-17 22:28:18 +00:00
2010-03-10 07:07:45 +00:00
2010-04-28 01:53:13 +00:00
2010-04-28 01:53:13 +00:00
2010-04-28 01:53:13 +00:00
2010-12-02 20:17:34 +00:00
2010-01-19 21:51:51 +00:00
2010-11-27 20:43:02 +00:00
2010-03-05 06:17:43 +00:00
2010-09-30 23:57:10 +00:00
2010-02-27 23:53:53 +00:00
2010-09-30 23:57:10 +00:00
2010-10-03 22:52:07 +00:00
2010-12-20 20:10:50 +00:00
2010-04-28 08:30:49 +00:00
2010-06-09 20:30:22 +00:00