llvm-6502/lib
Bill Wendling 43a6c5e2fc We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:41:22 +00:00
..
Analysis Revert r112432. It appears to be exposing a problem in the emacs build. 2010-08-31 20:58:44 +00:00
Archive Eliminate some unnessary Path::exists() calls. 2010-05-27 20:51:54 +00:00
AsmParser remove unions from LLVM IR. They are severely buggy and not 2010-08-28 04:09:24 +00:00
Bitcode remove unions from LLVM IR. They are severely buggy and not 2010-08-28 04:09:24 +00:00
CodeGen Reapply r112623. Included additional check for unused byval argument. 2010-08-31 22:22:42 +00:00
CompilerDriver Add a TODO. 2010-08-23 19:24:12 +00:00
ExecutionEngine Fix a comment. 2010-08-30 21:54:03 +00:00
Linker Reapply r112091 and r111922, support for metadata linking, with a 2010-08-26 15:41:53 +00:00
MC Allow creation of SHT_NULL sections, from Roman Divacky. 2010-08-31 17:03:33 +00:00
Support Remove a hack that tries to understand incorrect triples from the 2010-08-30 10:57:54 +00:00
System Some fixes for NetBSD 2010-08-31 22:38:00 +00:00
Target We have a chance for an optimization. Consider this code: 2010-08-31 22:41:22 +00:00
Transforms tidy up 2010-08-31 21:21:25 +00:00
VMCore Add comments explaining why it's not necessary to include the 2010-08-30 21:18:41 +00:00
Makefile