[all-commits] [llvm/llvm-project] 5a7a63: FixIrreducible: don't crash when moving a child loop

Sameer Sahasrabuddhe via All-commits all-commits at lists.llvm.org
Tue Apr 21 19:18:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a7a6382bc066b93cdd4c60a489b480d0e74a254
      https://github.com/llvm/llvm-project/commit/5a7a6382bc066b93cdd4c60a489b480d0e74a254
  Author: Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com>
  Date:   2020-04-22 (Wed, 22 Apr 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/FixIrreducible.cpp
    A llvm/test/Transforms/FixIrreducible/bug45623.ll

  Log Message:
  -----------
  FixIrreducible: don't crash when moving a child loop

Summary:
When an irreducible SCC is converted into a new natural loop, existing
loops included in that SCC now become children of the new loop. The
logic that moves these loops from the parent loop to the new loop
invoked undefined behaviour when it modified the container that it was
iterating over. Fixed this by first extracting all the loops that are
to be removed from the parent.

Fixes bug 45623.

Reviewed By: arsenm

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




More information about the All-commits mailing list