[PATCH] D154919: [LoongArch] Implement isSExtCheaperThanZExt

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 03:56:37 PDT 2023


xen0n added inline comments.


================
Comment at: llvm/test/CodeGen/LoongArch/atomicrmw-uinc-udec-wrap.ll:308
 ; LA64-NEXT:    # Child Loop BB6_3 Depth 2
-; LA64-NEXT:    bstrpick.d $a2, $a4, 31, 0
-; LA64-NEXT:    sltu $a5, $a3, $a2
+; LA64-NEXT:    addi.w $a5, $a4, 0
+; LA64-NEXT:    sltu $a2, $a3, $a5
----------------
hev wrote:
> Here. This sign extension instruction should be removed.
Okay. To be sure no one is forgetting about this you could add a note like "TODO: Optimize away the redundant sign extension before the atomicrmw loop" above the function, but if you're following up with a patch shortly it may be better to not do this (for less churn).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154919



More information about the llvm-commits mailing list