hhvm
hhvm copied to clipboard
AArch64: Add folds to use new cbz/cbnz block terminators
We can fold sequences like this:
testl w0, w0 jcc CC_E, label
into a single, new opcode
cbz w0, label
if the flags set by testl are only used by the jcc operation. Not only does this reduce the number of instructions, but it also has the benefit of not clobbering the flags. On AArch64 the branch offset range for cbz/cbnz is identical to b.cc so there is no penalty for using them.
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D86971426. (Because this pull request was imported automatically, there will not be any future comments.)