This is an archive of the discontinued LLVM Phabricator instance.

[NewGVN] Use PredicateInfo info when previously used for the same ssa.coy intrinsic
ClosedPublic

Authored by asbirlea on Sep 30 2021, 11:37 PM.

Details

Summary

Symbolic execution using PredicateInfo is only done for the ssa.copy
intrinsic. It's using two potential sources for building the expression:

  1. the Value of the instruction for which the instruction is a copy of, and
  2. the Value from the contraint in PredicateInfo

It's possible to get into an infinite loop when choosing between these
two, as described in PR31613.

This patch proposes performing swapping of the two values (i.e. choosing
the second one for the expression), if that same second value was chosen
before; this breaks the cycle.

In the testcases provided, where there is a contradiction between the
value from symbolic execution and assume instruction, NewGVN reduces the
assume to assume(false).

Resolves PR31613.

Diff Detail

Event Timeline

asbirlea created this revision.Sep 30 2021, 11:37 PM
asbirlea requested review of this revision.Sep 30 2021, 11:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2021, 11:37 PM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 13 2021, 4:54 PM
This revision was automatically updated to reflect the committed changes.