[PATCH] D91415: [InstCombine] add multi-use demanded bits fold for add with low-bit mask

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 10:11:45 PST 2020


spatel marked an inline comment as done.
spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:838
+      // just return the add's variable operand.
+      if ((*C & LowMask).isNullValue())
+        return I->getOperand(0);
----------------
RKSimon wrote:
> We could technically support non-uniform vectors here by matching m_Constant and using a similar ConstantExpr fold.
Ok - I didn't see any signs that we had tried non-uniform in this file yet. Do you think we should do that in this patch or as a TODO/follow-up?


================
Comment at: llvm/test/Transforms/InstCombine/and.ll:1052
 
+; Multi-use demanded bits - 'add' doesn't change 'and'
+
----------------
RKSimon wrote:
> Vector tests?
Basic splat is the last (positive) test.


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

https://reviews.llvm.org/D91415



More information about the llvm-commits mailing list