[PATCH] D89423: Explicitly check for entry basic block, rather than relying on MachineBasicBlock::pred_empty.

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 13:54:42 PDT 2020


tmsriram added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:3100
   // Print the main label for the block.
-  if (MBB.pred_empty() ||
-      (!MF->hasBBLabels() && isBlockOnlyReachableByFallthrough(&MBB) &&
-       !MBB.isEHFuncletEntry() && !MBB.hasLabelMustBeEmitted())) {
+  if (EmitMBBLabel) {
+    if (isVerbose() && MBB.hasLabelMustBeEmitted())
----------------
This is the only place that EmitMBBlabel is checked.  I don't see why you can't put that condition just directly after the if?



================
Comment at: llvm/test/CodeGen/X86/basic-block-sections-unreachable.ll:3
+; RUN: llc < %s -mtriple=x86_64 -O0 -basic-block-sections=all | FileCheck %s --check-prefixes=CHECK,CHECK-SECTIONS
+; RUN: llc < %s -mtriple=x86_64 -O0 | FileCheck %s --check-prefixes=CHECK,CHECK-NOSECTIONS
+define void @foo(i32* %bar) {
----------------
There are no CHECK: statements? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89423



More information about the llvm-commits mailing list