If we are using a simplified value, we need to add an extra
dependency this value , because changes to the class of the
simplified value may require us to invalidate any decision based on
that value.
This is done by adding such values as additional users, however the
current code does not excludes temporary instructions.
At the moment, this means that we miss those dependencies for
phi-of-ops, because they are temporary instructions at this point. We
instead need to add the extra dependencies to the root instruction of
the phi-of-ops.
This patch pushes the responsibility of adding extra users to the
callers of createExpression & performSymbolicEvaluation. At those
points, it is clearer which real instruction to pick.
Alternatively we could either pass the 'real' instruction as additional
argument or use another map, but I think the approach in the patch makes
things a bit easier to follow.
Fixes PR35074.
For consistency with the rest of the GVN APIs, I wound't add this functionality inside ExprResult.
I think an API akin to addAdditionalUsers, which queries the ExprResult for the dependency field and adds the user would maintain this consistency. It can even call addAdditionalUsers after the first two checks; and in the dependent patch, it would also call addPredicateUsers.
What do you think?