[llvm] [DAG] expandAVG - attempt to extend to a wider integer type for the add/shift to avoid overflow handling (PR #95788)
Phoebe Wang via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 18 19:17:23 PDT 2024
================
@@ -1973,11 +1973,11 @@ define void @not_avg_v16i8_wide_constants(ptr %a, ptr %b) nounwind {
define <1 x i8> @avg_v1i8(<1 x i8> %x, <1 x i8> %y) {
; CHECK-LABEL: avg_v1i8:
; CHECK: # %bb.0:
-; CHECK-NEXT: movl %edi, %eax
-; CHECK-NEXT: orb %sil, %al
-; CHECK-NEXT: xorb %sil, %dil
-; CHECK-NEXT: shrb %dil
-; CHECK-NEXT: subb %dil, %al
+; CHECK-NEXT: movzbl %sil, %eax
+; CHECK-NEXT: movzbl %dil, %ecx
+; CHECK-NEXT: leal 1(%rcx,%rax), %eax
----------------
phoebewang wrote:
This is no `+ 1` in the old code. Is it optimized due to `shrl`? Should we avoid it here too?
https://github.com/llvm/llvm-project/pull/95788
More information about the llvm-commits
mailing list