[PATCH] D88517: [BasicBlockSections] Make sure that the labels for address-taken blocks are emitted after switching the seciton.

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 13:19:30 PDT 2020


rahmanl added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:3051
+  // entry block is always placed in the function section and is handled
+  // separately.
+  if (MBB.isBeginSection() && !MBB.pred_empty()) {
----------------
snehasish wrote:
> Can you extend the comment here to state that this needs to happen before the `if (MBB.hasAddressTaken())` part below?
Thanks for the comment, but I am not sure if it's necessary. (Likewise the alignment code above must be before switching the section, but we don't explicitly mention that). 


================
Comment at: llvm/test/CodeGen/X86/basic-block-sections-blockaddress.ll:1
+;; This test verifies that basic-block-sections works with address-taken basic blocks.
+; RUN: llc < %s -mtriple=x86_64 -basic-block-sections=all | FileCheck %s
----------------
snehasish wrote:
> nit: perhaps a better name for this file is "basic-block-sections-address-taken.ll"
Changed the test name to basic-block-sections-blockaddress-taken.ll.


================
Comment at: llvm/test/CodeGen/X86/basic-block-sections-blockaddress.ll:28
+  ret void
+; CHECK:         .section .text,"ax", at progbits,unique,2
+; CHECK-NEXT:    .Ltmp1:
----------------
snehasish wrote:
> MaskRay wrote:
> > snehasish wrote:
> > > I think you meant to only indent the instructions, the labels should be indented less here and above?
> > The excess indentation is here to satisfy the longest directive CHECK-LABEL.
> Interesting, on my end I see that the indentation lines it up with the instructions below. Is this a phabricator quirk?
> https://paste.pics/ABM6T
The indentation for .Ltmp1: was incorrect. I fixed it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88517/new/

https://reviews.llvm.org/D88517



More information about the llvm-commits mailing list