HomePhabricator

[AArch64] Peephole rule to remove redundant cmp after cset.

Authored by ilinpv on Mar 8 2021, 4:18 PM.

Description

[AArch64] Peephole rule to remove redundant cmp after cset.

Comparisons to zero or one after cset instructions can be safely
removed in examples like:

cset w9, eq cset w9, eq
cmp w9, #1 ---> <removed>
b.ne .L1 b.ne .L1

cset w9, eq cset w9, eq
cmp w9, #0 ---> <removed>
b.ne .L1 b.eq .L1

Peephole optimization to detect suitable cases and get rid of that
comparisons added.

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

Details

Committed
ilinpvApr 19 2021, 11:58 AM
Differential Revision
D98564: [AArch64] Peephole rule to remove redundant cmp after cset.
Parents
rGd8805574c183: [CUDA][HIP] Allow non-ODR use of host var in device
Branches
Unknown
Tags
Unknown