[all-commits] [llvm/llvm-project] 911a54: [LazyValueInfo] Insert an Overdefined placeholder ...

Guo-Peilin via All-commits all-commits at lists.llvm.org
Fri May 7 01:07:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 911a541620bcc78e637589b8623d94b8f3cdafba
      https://github.com/llvm/llvm-project/commit/911a541620bcc78e637589b8623d94b8f3cdafba
  Author: Peilin Guo <guopeilin1 at huawei.com>
  Date:   2021-05-07 (Fri, 07 May 2021)

  Changed paths:
    M llvm/lib/Analysis/LazyValueInfo.cpp
    A llvm/test/Transforms/JumpThreading/insert-placeholder-to-prevent-infinite-recursion.ll

  Log Message:
  -----------
  [LazyValueInfo] Insert an Overdefined placeholder to prevent infinite recursion

getValueFromCondition() uses a Visited set to record the intermediate value.
However, it uses a postorder way to compute the value first and update the
Visited set later. Thus it will be trapped into an infinite recursion if there
exists IRs that use no dominated by its def as in this example:

  %tmp3 = or i1 undef, %tmp4
  %tmp4 = or i1 undef, %tmp3

To prevent this, we can insert an Overdefined placeholder into the set
before computing the actual value.

Reviewed by: nikic

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




More information about the All-commits mailing list