llvm-6502/test/CodeGen
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
..
Alpha PR7774: Fix undefined shifts in Alpha backend. As a bonus, this actually 2010-08-01 21:13:28 +00:00
ARM We have a chance for an optimization. Consider this code: 2010-08-31 22:41:22 +00:00
Blackfin Remove TargetInstrInfo::copyRegToReg entirely. 2010-07-11 17:01:17 +00:00
CBackend
CellSPU Fix lowering of INSERT_VECTOR_ELT in SPU. 2010-08-29 12:41:50 +00:00
CPP
Generic Fix a crash in the dag combiner caused by ConstantFoldBIT_CONVERTofBUILD_VECTOR calling itself 2010-07-27 18:02:18 +00:00
MBlaze Split big test into multiple directories to cater to 2010-04-07 20:43:35 +00:00
Mips Correct bogus module triple specifications. 2010-08-30 10:48:29 +00:00
MSP430 Insert ANY_EXTEND node instead of invalid truncate during DAG Combining (X & 1), 2010-05-01 12:52:34 +00:00
PIC16 Remove XFAIL for vg_leak as the leaks are fixed by 100601. 2010-04-07 07:06:48 +00:00
PowerPC PR7781: Fix incorrect shifting in PPCTargetLowering::LowerBUILD_VECTOR. 2010-08-02 00:18:19 +00:00
SPARC Split big test into multiple directories to cater to 2010-04-07 20:43:35 +00:00
SystemZ Correct bogus module triple specifications. 2010-08-30 10:48:29 +00:00
Thumb Update test for 112609 2010-08-31 17:58:47 +00:00
Thumb2 We have a chance for an optimization. Consider this code: 2010-08-31 22:41:22 +00:00
X86 two changes: 2010-08-30 18:12:35 +00:00
XCore Start function numbering at 0. 2010-04-17 16:29:15 +00:00