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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 08:51:05 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
----------------
topperc wrote:

bswapq is 2 uops vs 1 for bswapl on some CPU isn't it?

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


More information about the llvm-commits mailing list