[llvm] [DAG] expandAVG - attempt to extend to a wider integer type for the add/shift to avoid overflow handling (PR #95788)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 21 15:28:36 PDT 2024
================
@@ -167,11 +151,11 @@ define i32 @test_ext_i32(i32 %a0, i32 %a1) nounwind {
;
; X64-LABEL: test_ext_i32:
; X64: # %bb.0:
-; X64-NEXT: movl %edi, %eax
-; X64-NEXT: andl %esi, %eax
-; X64-NEXT: xorl %esi, %edi
-; X64-NEXT: sarl %edi
-; X64-NEXT: addl %edi, %eax
+; X64-NEXT: movslq %esi, %rcx
+; X64-NEXT: movslq %edi, %rax
+; X64-NEXT: addq %rcx, %rax
+; X64-NEXT: shrq %rax
+; X64-NEXT: # kill: def $eax killed $eax killed $rax
----------------
goldsteinn wrote:
So we can just replace `ShiftOpc` with `ISD::SRL` in the code?
https://github.com/llvm/llvm-project/pull/95788
More information about the llvm-commits
mailing list