[all-commits] [llvm/llvm-project] 5fbba3: [SimplifyCFG] Skip merging return blocks if it wo...

Jonas Paulsson via All-commits all-commits at lists.llvm.org
Thu Apr 16 11:12:43 PDT 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fbba36cbe93f12da5c4d6063db21cf35ecc9bfc
      https://github.com/llvm/llvm-project/commit/5fbba36cbe93f12da5c4d6063db21cf35ecc9bfc
  Author: Jonas Paulsson <paulsson at linux.vnet.ibm.com>
  Date:   2020-04-16 (Thu, 16 Apr 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
    A llvm/test/Transforms/SimplifyCFG/callbr-destinations.ll

  Log Message:
  -----------
  [SimplifyCFG]  Skip merging return blocks if it would break a CallBr.

SimplifyCFG should not merge empty return blocks and leave a CallBr behind
with a duplicated destination since the verifier will then trigger an
assert. This patch checks for this case and avoids the transformation.

CodeGenPrepare has a similar check which also has a FIXME comment about why
this is needed. It seems perhaps better if these two passes would eventually
instead update the CallBr instruction instead of just checking and avoiding.

This fixes https://bugs.llvm.org/show_bug.cgi?id=45062.

Review: Craig Topper

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

(cherry picked from commit c2dafe12dc24f7f1326f5c4c6a3b23f1485f1bd6)




More information about the All-commits mailing list