[all-commits] [llvm/llvm-project] 9d2df9: [DAG] computeKnownBits - add ISD::MULHS/MULHU/SMUL...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Mar 19 09:03:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d2df964070700ae0d244e84572ac2275050e49a
      https://github.com/llvm/llvm-project/commit/9d2df964070700ae0d244e84572ac2275050e49a
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AMDGPU/atomic_optimizations_global_pointer.ll
    M llvm/test/CodeGen/AMDGPU/atomic_optimizations_local_pointer.ll
    M llvm/test/CodeGen/AMDGPU/sdiv64.ll
    M llvm/test/CodeGen/AMDGPU/srem64.ll
    M llvm/test/CodeGen/AMDGPU/udiv64.ll
    M llvm/test/CodeGen/AMDGPU/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/AMDGPU/urem64.ll
    M llvm/test/CodeGen/ARM/select-imm.ll
    M llvm/test/CodeGen/M68k/Arith/divide-by-constant.ll
    M llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Thumb2/mve-vecreduce-mla.ll
    M llvm/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
    M llvm/test/CodeGen/X86/combine-udiv.ll
    M llvm/test/CodeGen/X86/omit-urem-of-power-of-two-or-zero-when-comparing-with-zero.ll
    M llvm/test/CodeGen/X86/smul_fix_sat_constants.ll
    M llvm/test/CodeGen/X86/umul_fix.ll

  Log Message:
  -----------
  [DAG] computeKnownBits - add ISD::MULHS/MULHU/SMUL_LOHI/UMUL_LOHI handling

Reuse the existing KnownBits multiplication code to handle the 'extend + multiply + extract high bits' pattern for multiply-high ops.

Noticed while looking at the codegen for D88785 / D98587 - the patch helps division-by-constant expansion code in particular, which suggests that we might have some further KnownBits div/rem cases we could handle - but this was far easier to implement.

Differential Revision: https://reviews.llvm.org/D98857




More information about the All-commits mailing list