[PATCH] D68811: [CVP] Remove a masking operation if range information implies it's a noop

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 13:17:34 PDT 2019


lebedev.ri added a comment.

Thanks, this looks ok to me, but i'll leave final review to others.



================
Comment at: lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:713
+  ConstantInt *RHS = dyn_cast<ConstantInt>(BinOp->getOperand(1));
+  if (!RHS || !RHS->getValue().isMask())
+    return false;
----------------
nikic wrote:
> The limit to masks seems a bit stronger than strictly necessary: The range needs to be <= than the trailing ones in RHS. That is for `0b11001111`, if the range is `<= 0b00001111` that is sufficient. Not sure if this is worth handling.
I'd say this is intentional to limit the number of `and`s we handle.


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

https://reviews.llvm.org/D68811





More information about the llvm-commits mailing list