[all-commits] [llvm/llvm-project] 1cc594: [NewGVN] Use performSymbolicEvaluation instead of ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Apr 24 10:49:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1cc5946cc80d75be76ac8a41e1a3697059273681
      https://github.com/llvm/llvm-project/commit/1cc5946cc80d75be76ac8a41e1a3697059273681
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-04-24 (Sat, 24 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    A llvm/test/Transforms/NewGVN/compare-condition-changes.ll

  Log Message:
  -----------
  [NewGVN] Use performSymbolicEvaluation instead of createExpression.

performSymbolicEvaluation is used to obtain the symbolic expression when
visiting instructions and this is used to determine their congruence
class.

performSymbolicEvaluation only creates expressions for certain
instructions (via createExpression). For unsupported instructions,
'unknown' expression are created.

The use of createExpression in processOutgoingEdges means we may
simplify the condition in processOutgoingEdges to a constant in the
initial round of processing, but we use Unknown(I) for the congruence
class. If an operand of I changes the expression Unknown(I) stays the
same, so there is no update of the congruence class of I. Hence it
won't get re-visited. So if an operand of I changes in a way that causes
createExpression to return different result, this update is missed.

This patch updates the code to use performSymbolicEvaluation, to be
symmetric with the congruence class updating code.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D99990




More information about the All-commits mailing list