[all-commits] [llvm/llvm-project] 216afd: [TargetLower] Update shouldFormOverflowOp check if...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Feb 19 02:30:16 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 216afd3301f3d96a8ec29d80da67b78cd9e99527
      https://github.com/llvm/llvm-project/commit/216afd3301f3d96a8ec29d80da67b78cd9e99527
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-02-19 (Wed, 19 Feb 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/lib/Target/ARM/ARMISelLowering.h
    M llvm/lib/Target/SystemZ/SystemZISelLowering.h
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.h
    M llvm/test/Transforms/CodeGenPrepare/SPARC/overflow-intrinsics.ll

  Log Message:
  -----------
  [TargetLower] Update shouldFormOverflowOp check if math is used.

On some targets, like SPARC, forming overflow ops is only profitable if
the math result is used: https://godbolt.org/z/DxSmdB
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, X86ISelLowering,
ARMISelLowering.h, SystemZISelLowering.h to allow 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.

Reviewers: nikic, RKSimon, lebedev.ri, spatel

Reviewed By: lebedev.ri

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




More information about the All-commits mailing list