[all-commits] [llvm/llvm-project] 6bd2b7: [SimpleLoopUnswitch] Add freeze if branch execs fo...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu May 5 01:44:46 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bd2b70877615bac018f54b09bd8c97155d52a45
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-05-05 (Thu, 05 May 2022)

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

  Log Message:
  [SimpleLoopUnswitch] Add freeze if branch execs for partial unswitching.

We cannot skip the freezing the condition if the unswitched branch
executes, if the condition is a chain of ANDs/ORs. For example, if if we
have an AND %c1, %c2 with  %c1 == undef and %c2 == 0, there would be no
branch on undef in the original code, but a branch on undef if we
unswitch %c1.

Reviewed By: nikic

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

More information about the All-commits mailing list