ArrayCopyBNDCHK nodes often take the following form, i.e. compare the result of a subtraction against immediate 0: ``` ------------------------------ n3643n ( 0) ArrayCopyBNDCHK [#1] n3642n ( 1) isub (cannotOverflow ) n3638n ( 1) ==>iloadi (X>=0 cannotOverflow ) n740n ( 3) ==>iloadi (cannotOverflow ) n3640n ( 3) ==>iconst 0 (X==0 X>=0 X<=0 ) ------------------------------ ``` ArrayCopyBNDCHKEvaluator for AArch64 generates code like the following in this case. ``` 0xffff9d23a220 000005fc [ 0xffff97bbcba0] 4b0b0000 26 subw w0, w0, w11 0xffff9d23a224 00000600 [ 0xffff97bbcc30] 7100001f 26 cmpimmw w0, 0 0xffff9d23a228 00000604 [ 0xffff97bbcd10] 54007deb 26 b.lt Snippet Label L0513 (Helper Call Snippet) ``` You can save one instruction here by changing it to: ``` cmpw w0, w11 b.lt Snippet Label L0513 ```
Activity
AArch64: Save one instruction in ArrayCopyBNDCHK when possible
AArch64: Save one instruction in ArrayCopyBNDCHK when possible