Go to file
Chad Rosier 6db9ff64a8 [AArch64] Prefer Bcc to CBZ/CBNZ/TBZ/TBNZ when NZCV flags can be set for "free".
This patch contains a pass that transforms CBZ/CBNZ/TBZ/TBNZ instructions into a
conditional branch (Bcc), when the NZCV flags can be set for "free". This is
preferred on targets that have more flexibility when scheduling Bcc
instructions as compared to CBZ/CBNZ/TBZ/TBNZ (assuming all other variables are
equal). This can reduce register pressure and is also the default behavior for
GCC.

A few examples:

 add w8, w0, w1  -> cmn w0, w1             ; CMN is an alias of ADDS.
 cbz w8, .LBB_2  -> b.eq .LBB0_2           ; single def/use of w8 removed.

 add w8, w0, w1  -> adds w8, w0, w1        ; w8 has multiple uses.
 cbz w8, .LBB1_2 -> b.eq .LBB1_2

 sub w8, w0, w1       -> subs w8, w0, w1   ; w8 has multiple uses.
 tbz w8, #31, .LBB6_2 -> b.ge .LBB6_2

In looking at all current sub-target machine descriptions, this transformation
appears to be either positive or neutral.

Differential Revision: https://reviews.llvm.org/D34220.

llvm-svn: 306144
2017-06-23 19:20:12 +00:00
clang [MS] Don't statically initialize dllimport member function pointers 2017-06-23 18:29:13 +00:00
clang-tools-extra [clang-tidy] Fix a false positive in modernize-use-nullptr. 2017-06-23 09:36:49 +00:00
compiler-rt [Sanitizers] 32 bit allocator respects allocator_may_return_null flag 2017-06-22 00:02:37 +00:00
debuginfo-tests Add a test for PR33166. 2017-05-25 19:33:16 +00:00
libclc generic: add missing get_work_dim include 2017-06-02 15:58:35 +00:00
libcxx Implement inclusive_scan/transform_inclusive_scan for C++17. 2017-06-23 05:12:42 +00:00
libcxxabi Add some catch(...) blocks to the tests so that if they fail, we get a good error message. No functional change. 2017-06-22 00:49:03 +00:00
libunwind Change -1LL to -1ULL to silence a gcc warning about left shifting a negative value. Fixes https://bugs.llvm.org/show_bug.cgi?id=33358 2017-06-21 16:02:53 +00:00
lld Silence -Wunused-variable warning 2017-06-23 18:22:29 +00:00
lldb Fix typo: using && instead of & when evaluating a mask 2017-06-23 18:20:13 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [AArch64] Prefer Bcc to CBZ/CBNZ/TBZ/TBNZ when NZCV flags can be set for "free". 2017-06-23 19:20:12 +00:00
openmp Set affinity to none/false in child processes 2017-06-15 21:51:07 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [ScopBuilder] Pass ScopStmts around instead of BasicBlocks. NFC. 2017-06-23 17:55:36 +00:00