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

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 12:37:12 PDT 2017


davide added a comment.

I think this is on the right direction (for me), but let's see what other think.
If we agree, it will probably make sense revamping the general semilattice engine to plug arbitrary lattices in (and move the constant semilattice out).
This will enable future improvements (i.e. support for IPA bitwise CP, see, e.g. https://patchwork.ozlabs.org/patch/657644/)



================
Comment at: include/llvm/Analysis/ValueLattice.h:123-125
+    if (isa<UndefValue>(V))
+      return;
+
----------------
Are you expecting the resolver to plug the correct value here?


================
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;
----------------
I think it's better to split this in two APIs (tryToReplaceWithConstant & tryToReplaceWithConstantRange)


https://reviews.llvm.org/D36656





More information about the llvm-commits mailing list