[all-commits] [llvm/llvm-project] 91eb44: [JumpThreading] NFC: Simplify ComputeValueKnownInP...

kazutakahirata via All-commits all-commits at lists.llvm.org
Tue Apr 7 18:43:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 91eb442fdef0aacb996442042d2eeed52d71270b
      https://github.com/llvm/llvm-project/commit/91eb442fdef0aacb996442042d2eeed52d71270b
  Author: Kazu Hirata <kazu at google.com>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/JumpThreading.h
    M llvm/lib/Transforms/Scalar/JumpThreading.cpp

  Log Message:
  -----------
  [JumpThreading] NFC: Simplify ComputeValueKnownInPredecessorsImpl

Summary:
ComputeValueKnownInPredecessorsImpl is the main folding mechanism in
JumpThreading.cpp.  To avoid potential infinite recursion while
chasing use-def chains, it uses:

  DenseSet<std::pair<Value *, BasicBlock *>> &RecursionSet

to keep track of Value-BB pairs that we've processed.

Now, when ComputeValueKnownInPredecessorsImpl recursively calls
itself, it always passes BB as is, so the second element is always BB.

This patch simplifes the function by dropping "BasicBlock *" from
RecursionSet.

Reviewers: wmi, efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list