[all-commits] [llvm/llvm-project] 13a973: [JumpThreading] Skip unconditional PredBB when thr...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Feb 18 11:04:16 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 13a97305ba77f44eccba16087320c8aa016ac6da
      https://github.com/llvm/llvm-project/commit/13a97305ba77f44eccba16087320c8aa016ac6da
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/JumpThreading.cpp
    A llvm/test/Transforms/JumpThreading/thread-two-bbs6.ll

  Log Message:
  -----------
  [JumpThreading] Skip unconditional PredBB when threading jumps through two basic blocks

Fixes https://bugs.llvm.org/show_bug.cgi?id=44922 (caused by 4698bf145d583e26ed438026ef7fde031ef322b1)

ThreadThroughTwoBasicBlocks assumes PredBBBranch is conditional. The following code can segfault.

  AddPHINodeEntriesForMappedBlock(PredBBBranch->getSuccessor(1), PredBB, NewBB,
                                  ValueMapping);

We can also allow unconditional PredBB, but the produced code is not
better.

Reviewed By: kazu

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




More information about the All-commits mailing list