[PATCH] D75120: [ValueLattice] Add new state for undef constants. (WIP)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 09:51:00 PST 2020


fhahn added a comment.

In D75120#1892449 <https://reviews.llvm.org/D75120#1892449>, @efriedma wrote:

> I'm not quite sure the merge function here is right.  I think constant_merged_with_undef has to be a different state from constant.  It's basically the same as constant, except that merging it with a different constant or constantrange produces overdefined.


Yes it still misses that case. I see it as the first step of the transition. To address the undef -> constant -> constant range merge issue there are a few options I think:

1. let caller deal with it, e.g. by passing in whether one of the merge operands is undefined.
2. Differentiate between constants that started out as undefined in ValueLattice, e.g. by adding another state like `constant_from_undef` (that would be a bit like forcedconstant, with the difference being that it cannot be marked as a different constant - which would go to overdefined for forced constant) or by using undefined + Constant pointer set.

Maybe there are other options? What would your preference be?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75120





More information about the llvm-commits mailing list