[PATCH] D83745: [ARM] Optimize immediate selection

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 07:42:58 PDT 2020


benshi001 added a comment.

In D83745#2175668 <https://reviews.llvm.org/D83745#2175668>, @SjoerdMeijer wrote:

> Eye balling the one test that was changed this indeed makes sense. But I would prefer to see some performance numbers first just to check we haven't missed anything.


Another improve in my patch is that

define i32 @sub2(i32 %0) {

  %2 = sub i32 %0, 8995
  ret i32 %2

}

Current llvm will put the imm 8995 in the constant pool and generate a LDR.

My patch will optimize it to 
; CHECK-NEXT:    sub r0, r0, #35
; CHECK-NEXT:    sub r0, r0, #8960

That  can be seen if https://reviews.llvm.org/D83928 is merged.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83745/new/

https://reviews.llvm.org/D83745





More information about the llvm-commits mailing list