[all-commits] [llvm/llvm-project] db04ff: [SimpleLoopUnswitch] Add non-empty unreachable blo...

Alina Sbirlea via All-commits all-commits at lists.llvm.org
Wed May 13 12:41:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: db04ff4b6bc3fbf5618556c52f8dd57a00790648
      https://github.com/llvm/llvm-project/commit/db04ff4b6bc3fbf5618556c52f8dd57a00790648
  Author: Alina Sbirlea <asbirlea at google.com>
  Date:   2020-05-13 (Wed, 13 May 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
    M llvm/test/Transforms/SimpleLoopUnswitch/trivial-unswitch.ll

  Log Message:
  -----------
  [SimpleLoopUnswitch] Add non-empty unreachable block check to exit cases removed.

Summary:
Update check to include the check for unreachable.

Basic blocks ending in unreachable are special cased, as these blocks may be already unswitched. Before this patch this check is only done for the default destination.
The condition for the exit cases and the default case must be the same, because we should never leave edges from the switch instruction to a basic block that we are unswitching. In PR45355 we still have a remaining edge (that we're attempting to remove from the DT) because its the default edge to an unreachable-terminated block where we unswitch a case edge to that block.

Resolves PR45355.

Reviewers: chandlerc

Subscribers: hiraditya, uabelho, llvm-commits

Tags: #llvm

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


  Commit: bd541b217f4d750391677144ccaa586874236f38
      https://github.com/llvm/llvm-project/commit/bd541b217f4d750391677144ccaa586874236f38
  Author: Alina Sbirlea <asbirlea at google.com>
  Date:   2020-05-13 (Wed, 13 May 2020)

  Changed paths:
    M clang/test/CodeGen/thinlto-distributed-newpm.ll
    M llvm/include/llvm/Analysis/AliasAnalysis.h
    M llvm/include/llvm/Analysis/CGSCCPassManager.h
    M llvm/include/llvm/IR/PassManager.h
    M llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
    M llvm/lib/Analysis/CGSCCPassManager.cpp
    M llvm/lib/Transforms/Coroutines/CoroSplit.cpp
    M llvm/lib/Transforms/IPO/Inliner.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
    M llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
    M llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
    M llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
    M llvm/lib/Transforms/Utils/CallGraphUpdater.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
    M llvm/unittests/IR/PassManagerTest.cpp
    M llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp

  Log Message:
  -----------
  [NewPassManager] Add assertions when getting statefull cached analysis.

Summary:
Analyses that are statefull should not be retrieved through a proxy from
an outer IR unit, as these analyses are only invalidated at the end of
the inner IR unit manager.
This patch disallows getting the outer manager and provides an API to
get a cached analysis through the proxy. If the analysis is not
stateless, the call to getCachedResult will assert.

Reviewers: chandlerc

Subscribers: mehdi_amini, eraman, hiraditya, zzheng, llvm-commits

Tags: #llvm

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


Compare: https://github.com/llvm/llvm-project/compare/704b539f65b7...bd541b217f4d


More information about the All-commits mailing list