[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:57:37 PDT 2020


RKSimon added a comment.

In D85446#2200214 <https://reviews.llvm.org/D85446#2200214>, @lebedev.ri wrote:

> We miss a similar thing for `sdiv exact %x, -1<<C  -->  -(ashr exact %x, C)`
> I can take over this patch if you prefer.

If you're offering - that'd be great, thank you! I randomly came across that we match this in DAG but not IR.....

Also I'm rather disappointed how often we have code that just matches m_ConstantInt where m_APInt (which would match uniform vectors with no undefs) or a full m_Constant could be used (possibly in conjunction with ConstantExpr) - it feels like something we should be aiming for.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85446/new/

https://reviews.llvm.org/D85446



More information about the llvm-commits mailing list