[all-commits] [llvm/llvm-project] 4ad895: [CodeGen][BasicBlockSections] Fix wrong alignment ...

sinan via All-commits all-commits at lists.llvm.org
Wed Nov 16 23:02:46 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ad8952d2d89243c776a40039dc4d54c8cd43e8d
      https://github.com/llvm/llvm-project/commit/4ad8952d2d89243c776a40039dc4d54c8cd43e8d
  Author: Sinan Lin <sinan.lin at linux.alibaba.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    A llvm/test/CodeGen/X86/align-basic-block-sections.mir

  Log Message:
  -----------
  [CodeGen][BasicBlockSections] Fix wrong alignment directive placement in
basic block section cases

MachineBlockPlacement pass sets an alignment attribute to the loop
header MBB and this attribute will lead to an alignment directive during
emitting asm. In the case of the basic block section, the alignment
directive is put before the section label, and thus the alignment is set
to the predecessor of the loop header, which is not what we expect and
increases the code size (both inserting nop and set section alignment).

Reviewed By: rahmanl

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




More information about the All-commits mailing list