[PATCH] D13740: Catch combine opportunities for redundant imuls

Zia Ansari via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 13:28:44 PDT 2015


zansari created this revision.
zansari added reviewers: mkuper, delena, spatel, hfinkel.
zansari added a subscriber: llvm-commits.

When we fold (mul (add x, c1), c1) -> (add (mul x, c2), c1*c2), we bail if (add x, c1) has multiple users, leaving and extra add instruction. In such cases, this patch adds a check to see if we can eliminate a multiply instruction in exchange for the extra add. combine-multiplies.ll illustrates this issue in a little more detail.

http://reviews.llvm.org/D13740

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/combine-multiplies.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13740.37382.patch
Type: text/x-patch
Size: 7215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151014/8a20a921/attachment.bin>


More information about the llvm-commits mailing list