[PATCH] D104665: [instcombine] Fold overflow check using umulo to comparison

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 12:51:31 PDT 2021


reames created this revision.
reames added reviewers: spatel, craig.topper.
Herald added subscribers: javed.absar, bollu, hiraditya, mcrosier.
reames requested review of this revision.
Herald added a project: LLVM.

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 an extracting the overflow flag.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104665

Files:
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/umulo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104665.353462.patch
Type: text/x-patch
Size: 4914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210621/d3be699e/attachment.bin>


More information about the llvm-commits mailing list