[PATCH] D75055: [ValueLattice] Merging a constant range with undefined is overdefined.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 09:44:07 PST 2020


nikic added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueLattice.h:261
+      // that for constants (or single-element ranges), we will replace all uses
+      // and we can assume undef == other constant.
+      if (isConstantRange() && !getConstantRange().isSingleElement()) {
----------------
I don't think this reasoning holds up for LVI. While we *could* replace all uses, nothing actually forces consumers of LVI to do so. And in practice, I don't believe that either JumpThreading or CVP will replace all constant lattice values. JT only looks at br/switch and CVP mostly does range-based simplifications.


================
Comment at: llvm/test/Transforms/CorrelatedValuePropagation/merge-range-and-undef.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -correlated-propagation %s | FileCheck %s
+
----------------
Can you please pre-commit, so diffs are visible here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75055





More information about the llvm-commits mailing list