[all-commits] [llvm/llvm-project] f8d721: [GlobalStatus] Keep Visited set in isSafeToDestroy...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Feb 22 01:03:15 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8d72100323b127b39fed5f5890b86d81b8a0335
      https://github.com/llvm/llvm-project/commit/f8d72100323b127b39fed5f5890b86d81b8a0335
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-02-22 (Tue, 22 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/GlobalStatus.cpp

  Log Message:
  -----------
  [GlobalStatus] Keep Visited set in isSafeToDestroyConstant()

Constants cannot be cyclic, but they can be tree-like. Keep a
visited set to ensure we do not degenerate to exponential run-time.

This fixes the problem reported in https://reviews.llvm.org/D117223#3335482,
though I haven't been able to construct a concise test case for
the issue. This requires a combination of dead constants and the
kind of constant expression tree that textual IR cannot represent
(because the textual representation, unlike the in-memory
representation, is also exponential in size).




More information about the All-commits mailing list