llvm-6502/lib/CodeGen/SelectionDAG
Evan Cheng 8a7186dbc2 Let targets provide hooks that compute known zero and ones for any_extend
and extload's. If they are implemented as zero-extend, or implicitly
zero-extend, then this can enable more demanded bits optimizations. e.g.

define void @foo(i16* %ptr, i32 %a) nounwind {
entry:
  %tmp1 = icmp ult i32 %a, 100
  br i1 %tmp1, label %bb1, label %bb2
bb1:
  %tmp2 = load i16* %ptr, align 2
  br label %bb2
bb2:
  %tmp3 = phi i16 [ 0, %entry ], [ %tmp2, %bb1 ]
  %cmp = icmp ult i16 %tmp3, 24
  br i1 %cmp, label %bb3, label %exit
bb3:
  call void @bar() nounwind
  br label %exit
exit:
  ret void
}

This compiles to the followings before:
        push    {lr}
        mov     r2, #0
        cmp     r1, #99
        bhi     LBB0_2
@ BB#1:                                 @ %bb1
        ldrh    r2, [r0]
LBB0_2:                                 @ %bb2
        uxth    r0, r2
        cmp     r0, #23
        bhi     LBB0_4
@ BB#3:                                 @ %bb3
        bl      _bar
LBB0_4:                                 @ %exit
        pop     {lr}
        bx      lr

The uxth is not needed since ldrh implicitly zero-extend the high bits. With
this change it's eliminated.

rdar://12771555


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169459 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 01:28:01 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
DAGCombiner.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
FastISel.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
FunctionLoweringInfo.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
InstrEmitter.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
InstrEmitter.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
LegalizeDAG.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
LegalizeFloatTypes.cpp Follow the same routine to add target float expansion hook 2012-10-11 07:22:01 +00:00
LegalizeIntegerTypes.cpp Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this! 2012-10-24 17:25:11 +00:00
LegalizeTypes.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
LegalizeTypes.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
LegalizeTypesGeneric.cpp Fix big-endian codegen bug in DAGTypeLegalizer::ExpandRes_BITCAST 2012-10-12 15:42:58 +00:00
LegalizeVectorOps.cpp Mark FP_EXTEND form v2f32 to v2f64 as "expand" for ARM NEON. Patch by Pete Couperus. 2012-11-17 01:52:46 +00:00
LegalizeVectorTypes.cpp Cleanup recent addition of DAGTypeLegalizer::SplitVecOp_VSELECT 2012-11-29 19:42:09 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile
ResourcePriorityQueue.cpp Simplify code. No functionality change. 2012-12-04 01:00:52 +00:00
ScheduleDAGFast.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
ScheduleDAGRRList.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
ScheduleDAGSDNodes.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
ScheduleDAGSDNodes.h Add a really faster pre-RA scheduler (-pre-RA-sched=linearize). It doesn't use 2012-10-17 19:39:36 +00:00
ScheduleDAGVLIW.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
SDNodeDbgValue.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
SDNodeOrdering.h Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-18 02:01:41 +00:00
SelectionDAG.cpp Let targets provide hooks that compute known zero and ones for any_extend 2012-12-06 01:28:01 +00:00
SelectionDAGBuilder.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
SelectionDAGBuilder.h Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
SelectionDAGDumper.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
SelectionDAGISel.cpp Use dyn_cast instead of isa and cast. No functionality change. 2012-12-04 00:50:06 +00:00
SelectionDAGPrinter.cpp Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
TargetLowering.cpp Let targets provide hooks that compute known zero and ones for any_extend 2012-12-06 01:28:01 +00:00
TargetSelectionDAGInfo.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00