Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not remove certain casts with contained operands (#74602)
On ARM64, we turn the "EQ(CAST<byte>(x), 0)" into "TEST_EQ(x, 0xFF)", to avoid materializing the cast. However, this breaks recognition of the "cb[n]z" idiom. If "x" ends up in a register, that's ok - we're essentially exchanging relop for a cast. If, however, it was contained, it is better to leave it alone: ``` - ldr w0, [fp,#0x18] - tst w0, #255 - bne G_M25131_IG10 - ;; size=12 bbWeight=1 PerfScore 3.50 + ldrb w0, [fp,#0x18] + cbnz w0, G_M25131_IG10 + ;; size=8 bbWeight=1 PerfScore 3.00 ```
- Loading branch information