• georgia.kouveli's avatar
    [arm64] Generate adds/ands. · 317dc057
    georgia.kouveli authored
    Perform the following transformation:
    
        | Before           | After               |
        |------------------+---------------------|
        | add w2, w0, w1   | adds w2, w0, w1     |
        | cmp w2, #0x0     | b.<cond'> <addr>    |
        | b.<cond> <addr>  |                     |
        |------------------+---------------------|
        | add w2, w0, w1   | adds w2, w0, w1     |
        | cmp #0x0, w2     | b.<cond'> <addr>    |
        | b.<cond> <addr>  |                     |
    
    and the same for and instructions instead of add.  When the result of the
    add/and is not used, generate cmn/tst instead. We need to take care with which
    conditions we can handle and what new condition we map them to.
    
    BUG=
    
    Review-Url: https://codereview.chromium.org/2065243005
    Cr-Commit-Position: refs/heads/master@{#37400}
    317dc057
test-branch-combine.cc 26.6 KB