[PATCH] D154919: [LoongArch] Implement isSExtCheaperThanZExt
    WÁNG Xuěruì via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jul 19 23:53:06 PDT 2023
    
    
  
xen0n added inline comments.
================
Comment at: llvm/test/CodeGen/LoongArch/ir-instruction/br.ll:29-30
 ; LA64:       # %bb.0:
-; LA64-NEXT:    ld.wu $a2, $a1, 0
-; LA64-NEXT:    bstrpick.d $a0, $a0, 31, 0
+; LA64-NEXT:    ld.w $a2, $a1, 0
+; LA64-NEXT:    addi.w $a0, $a0, 0
 ; LA64-NEXT:    beq $a2, $a0, .LBB1_2
----------------
hev wrote:
> Future patches will utilize the W instruction, thereby eliminating unnecessary sign extensions.
Mind explaining a bit what's the codegen you intended? Right now I couldn't think of a `*.w` instruction that would allow us to reduce this basic block any further.
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