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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 09:07:45 PST 2020


RKSimon 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);
----------------
We could technically support non-uniform vectors here by matching m_Constant and using a similar ConstantExpr fold.


================
Comment at: llvm/test/Transforms/InstCombine/and.ll:1052
 
+; Multi-use demanded bits - 'add' doesn't change 'and'
+
----------------
Vector tests?


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

https://reviews.llvm.org/D91415



More information about the llvm-commits mailing list