[PATCH] D85446: [InstCombine] Add vector support to mul(add(x,c),negpow2) -> mul(sub(-c,x),pow2) folds

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 09:34:27 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: lebedev.ri, spatel.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
RKSimon requested review of this revision.

Generalize the negated pow2 folds to support vectors - it looks like some other shl(add(x,c1),c2) -> add(shl(x,c2),c3) style folds are conflicting but only affect scalar / non-uniform vectors - I'll address this in a future patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85446

Files:
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/test/Transforms/InstCombine/mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85446.283639.patch
Type: text/x-patch
Size: 6659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200806/3cbca319/attachment.bin>


More information about the llvm-commits mailing list