[all-commits] [llvm/llvm-project] 810b5c: [NewGVN] add context instruction for SimplifyQuery

chenglin.bi via All-commits all-commits at lists.llvm.org
Tue Jun 21 21:25:39 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 810b5c471fe3b7f8b1e0038d2a9c5a2f47d49717
  Author: chenglin.bi <chenglin.bi at cixcomputing.com>
  Date:   2022-06-22 (Wed, 22 Jun 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    A llvm/test/Transforms/NewGVN/sq-ctxi.ll

  Log Message:
  [NewGVN] add context instruction for SimplifyQuery

NewGVN will find operator from other context. ValueTracking currently doesn't have a way to run completely without context instruction.
So it will use operator itself as conext instruction.
If the operator in another branch will never be executed but it has an assume, it may caused value tracking use the assume to do wrong simpilfy.

It would be better to make these simplification queries not use context at all, but that would require some API changes.
For now we just use the orignial instruction as context instruction to fix the issue.

Fix #56039

Reviewed By: nikic

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

More information about the All-commits mailing list