[all-commits] [llvm/llvm-project] 2cd23e: [instcombine] Fold overflow check using umulo to c...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Jun 25 10:25:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2cd23eb2438238b1297ff7b4368d673c449ff24f
      https://github.com/llvm/llvm-project/commit/2cd23eb2438238b1297ff7b4368d673c449ff24f
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-06-25 (Fri, 25 Jun 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/umulo.ll

  Log Message:
  -----------
  [instcombine] Fold overflow check using umulo to comparison

If we have a umul.with.overflow where the multiply result is not used and one of the operands is a constant, we can perform the overflow check cheaper with a comparison then by performing the multiply and extracting the overflow flag.

(Noticed when looking at the conditions SCEV emits for overflow checks.)

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




More information about the All-commits mailing list