[PATCH] D36656: [SCCP] Propagate integer range information in IPSCCP (WIP).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 13:52:54 PDT 2017


fhahn added a reviewer: dberlin.
fhahn added inline comments.


================
Comment at: include/llvm/Analysis/ValueLattice.h:123-125
+    if (isa<UndefValue>(V))
+      return;
+
----------------
davide wrote:
> Are you expecting the resolver to plug the correct value here?
I am not sure what you mean here. Are you referring to the assert? The caller is responsible to make sure that markConstant is not called with different constant values (e.g. in mergeIn).


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1587
 
-static bool tryToReplaceWithConstant(SCCPSolver &Solver, Value *V) {
+static bool tryToReplaceWithConstant(SCCPSolver &Solver, Value *V, SmallPtrSet<Instruction*,4> &ToRemove) {
   Constant *Const = nullptr;
----------------
davide wrote:
> I think it's better to split this in two APIs (tryToReplaceWithConstant & tryToReplaceWithConstantRange)
Yes and it makes the code quite a bit simpler too


https://reviews.llvm.org/D36656





More information about the llvm-commits mailing list