[PATCH] D74722: [TargetLower] Update shouldFormOverflowOp check if math is used.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 08:28:41 PST 2020


fhahn created this revision.
fhahn added reviewers: nikic, RKSimon, lebedev.ri, spatel.
Herald added subscribers: jrtc27, fedor.sergeev, hiraditya, kristof.beyls, jyknight.
Herald added a project: LLVM.

On some targets, like SPARC, forming overflow ops is only profitable if
the math result is used. This patch adds a new MathUsed parameter to
allow the targets to make the decision and defaults to only allowing it
if the math result is used. That is the conservative choice.

This patch also updates AArch64ISelLowering and X86ISelLowering to all
forming overflow ops if the math result is not used. On those targets
using the overflow intrinsic for the overflow check only generates
better code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74722

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/test/Transforms/CodeGenPrepare/SPARC/overflow-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74722.244982.patch
Type: text/x-patch
Size: 6794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200217/6d713f72/attachment.bin>


More information about the llvm-commits mailing list