[llvm] [ExpandMemCmp] Optimize ExpandMemCmp to reduce instruction count on x86 (PR #69609)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 09:35:28 PDT 2023


================
@@ -537,8 +529,8 @@ define i32 @length12(ptr %X, ptr %Y) nounwind {
 ; X64-NEXT:  # %bb.1: # %loadbb1
 ; X64-NEXT:    movl 8(%rdi), %ecx
 ; X64-NEXT:    movl 8(%rsi), %edx
-; X64-NEXT:    bswapl %ecx
-; X64-NEXT:    bswapl %edx
+; X64-NEXT:    bswapq %rcx
----------------
RKSimon wrote:

Also, on MOVBE targets this will no longer fold the loads.

https://github.com/llvm/llvm-project/pull/69609


More information about the llvm-commits mailing list