[PATCH] D98857: [DAG] computeKnownBits - add ISD::MULHS/ISD::MULHU handling

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 05:15:11 PDT 2021


RKSimon created this revision.
RKSimon added reviewers: spatel, dmgreen, arsenm, foad, nagisa, craig.topper, lebedev.ri.
Herald added subscribers: dexonsmith, kerbowa, pengfei, hiraditya, nhaehnle, jvesely, nemanjai.
RKSimon requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/D88785> / D98587 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98857

Files:
  llvm/include/llvm/Support/KnownBits.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/Support/KnownBits.cpp
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_global_pointer.ll
  llvm/test/CodeGen/AMDGPU/atomic_optimizations_local_pointer.ll
  llvm/test/CodeGen/AMDGPU/sdiv64.ll
  llvm/test/CodeGen/AMDGPU/srem64.ll
  llvm/test/CodeGen/AMDGPU/udiv64.ll
  llvm/test/CodeGen/AMDGPU/urem-seteq-illegal-types.ll
  llvm/test/CodeGen/AMDGPU/urem64.ll
  llvm/test/CodeGen/ARM/select-imm.ll
  llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll
  llvm/test/CodeGen/X86/2008-04-17-CoalescerBug.ll
  llvm/test/CodeGen/X86/combine-udiv.ll
  llvm/test/CodeGen/X86/omit-urem-of-power-of-two-or-zero-when-comparing-with-zero.ll
  llvm/unittests/Support/KnownBitsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98857.331519.patch
Type: text/x-patch
Size: 46824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210318/44dc198c/attachment.bin>


More information about the llvm-commits mailing list