hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

AArch64: Add folds to use new cbz/cbnz block terminators

Open david-arm opened this issue 1 month ago • 1 comments

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.

david-arm avatar Nov 13 '25 14:11 david-arm

@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.)

meta-codesync[bot] avatar Nov 13 '25 14:11 meta-codesync[bot]