[PATCH] D153614: [CSKY] Optimize ANDI/ORI to BCLRI/BSETI for specific immediates

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 03:37:26 PDT 2023


benshi001 added inline comments.


================
Comment at: llvm/test/CodeGen/CSKY/bseti_bclri.ll:7
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    ori32 a0, a0, 128
 ; CHECK-NEXT:    rts16
----------------
This case is not optimized to `BSETI` due to the immediate can be directly encoded in to `ORI32`.


================
Comment at: llvm/test/CodeGen/CSKY/bseti_bclri.ll:25
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    ori32 a0, a0, 192
 ; CHECK-NEXT:    rts16
----------------
This case is not optimized to `BSETI` due to the immediate can be directly encoded in to `ORI32`.


================
Comment at: llvm/test/CodeGen/CSKY/bseti_bclri.ll:64
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    andni32 a0, a0, 128
 ; CHECK-NEXT:    rts16
----------------
This case can not be optimized to `BCLRI` due to the immediate can be directly encoded into `ANDNI`.


================
Comment at: llvm/test/CodeGen/CSKY/bseti_bclri.ll:82
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    andni32 a0, a0, 192
 ; CHECK-NEXT:    rts16
----------------
This case can not be optimized to `BCLRI` due to the immediate can be directly encoded into `ANDNI`.


================
Comment at: llvm/test/CodeGen/CSKY/bseti_bclri.ll:99
 ; CHECK-LABEL: test_andnot_1966608:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    movih32 a1, 65505
----------------
This case can not be optimized to `BCLRI` due to the immediate has more the more than one zero-bit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153614



More information about the llvm-commits mailing list