[PATCH] D24956: [SelectionDAG] Add expansion and promotion of [US]MUL_LOHI

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 03:36:56 PDT 2016


nhaehnle created this revision.
nhaehnle added reviewers: spatel, bkramer, venkatra, efriedma, hfinkel, ast, nadav, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
Herald added subscribers: nhaehnle, wdng, nemanjai, jyknight, arsenm.

Most targets set the action for these nodes to Expand even though there
isn't actually any code for them in ExpandNode. Instead, targets simply
relied on the fact that no code generates these nodes as long as the
nodes aren't legal or custom.

However, generating these nodes can be useful e.g. for divide-by-constant
in wider integer types. Targets will want to deal with [US]MUL_LOHI
differently depending on the available instructions, e.g. targets with a
native 64-bit multiply will want to Promote the 32-bit [US]MUL_LOHI
instructions, and targets with native MULH[US] instructions will want to
Split.

This patch intends to not change the generated code, but indirect effects
are possible since expansions/promotions that were previously done in
DAGCombine may now be done in LegalizeDAG.

See D24822 for a change that actually uses the new expansion.

https://reviews.llvm.org/D24956

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  lib/Target/AMDGPU/AMDGPUISelLowering.h
  lib/Target/BPF/BPFISelLowering.cpp
  lib/Target/BPF/BPFISelLowering.h
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/PowerPC/PPCISelLowering.h
  lib/Target/Sparc/SparcISelLowering.cpp
  lib/Target/Sparc/SparcISelLowering.h
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24956.72620.patch
Type: text/x-patch
Size: 27787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160927/2c82c83d/attachment.bin>


More information about the llvm-commits mailing list