[all-commits] [llvm/llvm-project] b87bf7: [BOLT] Fix creation of invalid CFG in presence of ...

Rafael Auler via All-commits all-commits at lists.llvm.org
Tue Apr 11 17:20:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b87bf7442805d48102404f76503237106f6b950a
      https://github.com/llvm/llvm-project/commit/b87bf7442805d48102404f76503237106f6b950a
  Author: Rafael Auler <rafaelauler at fb.com>
  Date:   2023-04-11 (Tue, 11 Apr 2023)

  Changed paths:
    M bolt/lib/Core/BinaryFunction.cpp
    A bolt/test/X86/unreachable-jmp.s

  Log Message:
  -----------
  [BOLT] Fix creation of invalid CFG in presence of dead code

When there is a direct jump right after an indirect one, in
the absence of code jumpting to this direct jump, this is obviously
dead code. However, BOLT was failing to recognize that by mistakenly
placing both jmp instructions in the same basic block, and creating
wrong successor edges. Fix that, so we can safely run UCE on
that. This bug also causes validateCFG to fail and BOLT to crash if it
is running ICP on that function.

Reviewed By: #bolt, Amir

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




More information about the All-commits mailing list