[PATCH] D71936: [SCCP] Use constant ranges for binary operators.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 05:24:40 PDT 2020


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


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:1023
+
+    ConstantRange R = A.binaryOp(cast<BinaryOperator>(&I)->getOpcode(), B);
+    mergeInValue(&I, LatticeVal::getRange(R));
----------------
efriedma wrote:
> Can we also use this codepath if one of the operands is overdefined/notconstant?  We aren't using any interesting information about the "constant" operand anyway.
Yes! we only miss out on some vector cases, but they do not seem to matter much in practice. I plan to better support those cases by using SimplifyBinOp for constants and overdefined operands.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71936





More information about the llvm-commits mailing list