[PATCH] D60581: [ValueLattice] Make mark* functions public, return if value changed.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 9 14:19:17 PST 2020


nikic added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueLattice.h:292
+    assert(isConstant() && "No integer constant");
+    return dyn_cast<ConstantInt>(getConstant());
   }
----------------
I'm confused -- how can this method ever return non-null? Isn't `ConstantInt` canonicalized to ranges?


================
Comment at: llvm/include/llvm/Analysis/ValueLattice.h:309
+      CR = getConstantRange();
+    else if (isConstant() && getConstantInt())
+      CR = ConstantRange(getConstantInt()->getValue());
----------------
And related to the previous comment: Why are these changes needed? This shouldn't happen.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60581





More information about the llvm-commits mailing list