[all-commits] [llvm/llvm-project] 9bd8bc: [NFC][SimplifyCFG] PerformBranchToCommonDestFoldin...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Jan 22 14:33:50 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9bd8bcf993f6e829b2417deefbab78c610436a11
      https://github.com/llvm/llvm-project/commit/9bd8bcf993f6e829b2417deefbab78c610436a11
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-01-23 (Sat, 23 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll

  Log Message:
  -----------
  [NFC][SimplifyCFG] PerformBranchToCommonDestFolding(): fix instruction name preservation

NewBonusInst just took name from BonusInst, so BonusInst has no name,
so BonusInst.getName() makes no sense.
So we need to ask NewBonusInst for the name.


  Commit: e8387500059e7f3c261b2127a241b2c4c81ab36b
      https://github.com/llvm/llvm-project/commit/e8387500059e7f3c261b2127a241b2c4c81ab36b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-01-23 (Sat, 23 Jan 2021)

  Changed paths:
    M llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll

  Log Message:
  -----------
  [NFC][SimplifyCFG] fold-branch-to-common-dest.ll: reduce complexity of @pr48450* test

We don't need that many iterations there,
having less iterations helps alive2 verify it.


  Commit: eae1cc0de5b9c3b97ce1b6f4275b474ab10b83d0
      https://github.com/llvm/llvm-project/commit/eae1cc0de5b9c3b97ce1b6f4275b474ab10b83d0
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-01-23 (Sat, 23 Jan 2021)

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

  Log Message:
  -----------
  [NFC][SimplifyCFG] PerformBranchToCommonDestFolding(): move instruction cloning to after CFG update

This simplifies follow-up patch, and is NFC otherwise.


  Commit: 17422038442c9e2b572c7324b5a22d32e7fd9b83
      https://github.com/llvm/llvm-project/commit/17422038442c9e2b572c7324b5a22d32e7fd9b83
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-01-23 (Sat, 23 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/CodeGen/Thumb2/mve-float16regloops.ll
    M llvm/test/CodeGen/Thumb2/mve-float32regloops.ll
    M llvm/test/CodeGen/Thumb2/mve-postinc-lsr.ll
    M llvm/test/Transforms/LoopUnroll/peel-loop-inner.ll
    M llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll

  Log Message:
  -----------
  [SimplifyCFG] FoldBranchToCommonDest(): re-lift restrictions on liveout uses of bonus instructions

I have previously tried doing that in
b33fbbaa34f0fe9fb16789afc72ae424c1825b69 / d38205144febf4dc42c9270c6aa3d978f1ef65e1,
but eventually it was pointed out that the approach taken there
was just broken wrt how the uses of bonus instructions are updated
to account for the fact that they should now use either bonus instruction
or the cloned bonus instruction. In particluar, all that manual handling
of PHI nodes in successors was just wrong.

But, the fix is actually much much simpler than my initial approach:
just tell SSAUpdate about both instances of bonus instruction,
and let it deal with all the PHI handling.

Alive2 confirms that the reproducers from the original bugs (@pr48450*)
are now handled correctly.

This effectively reverts commit 59560e85897afc50090b6c3d920bacfd28b49d06,
effectively relanding b33fbbaa34f0fe9fb16789afc72ae424c1825b69.


Compare: https://github.com/llvm/llvm-project/compare/0be9ca7c0f9a...17422038442c


More information about the All-commits mailing list