1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib
Evan Cheng c1db873871 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

llvm-svn: 169459
2012-12-06 01:28:01 +00:00
..
Analysis Have CannotBeNegativeZero() be aware of the nsz fast-math flag 2012-12-06 00:07:09 +00:00
Archive Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
AsmParser Split up the ParseOptionalAttrs method into three different methods for each 2012-12-04 23:40:58 +00:00
Bitcode Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
CodeGen Let targets provide hooks that compute known zero and ones for any_extend 2012-12-06 01:28:01 +00:00
DebugInfo Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
ExecutionEngine Adjust JIT target triple on OS X to match the current architecture. 2012-12-05 19:09:13 +00:00
Linker Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
MC change MCContext to work on the doInitialization/doFinalization model 2012-12-06 00:50:55 +00:00
Object Use the new script to sort the includes of every file under lib. 2012-12-03 16:50:05 +00:00
Option Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
Support Make NaCl naming consistent. The triple OSType is called NaCl and is represented 2012-12-04 18:37:26 +00:00
TableGen Sort includes for all of the .h files under the 'lib' tree. These were 2012-12-04 07:12:27 +00:00
Target Let targets provide hooks that compute known zero and ones for any_extend 2012-12-06 01:28:01 +00:00
Transforms Set the 'MadeChange' variable if we are deleting blocks. 2012-12-06 00:30:20 +00:00
VMCore Fix name. The array is unboundED. 2012-12-05 21:43:30 +00:00
CMakeLists.txt Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
LLVMBuild.txt Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00
Makefile Copy clang/Driver/<Option parsing stuff> to llvm. 2012-12-05 00:29:32 +00:00