[all-commits] [llvm/llvm-project] 36cecd: [MIPS] Use generic isBlockOnlyReachableByFallthrou...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Feb 6 15:50:04 PST 2024


  Branch: refs/heads/release/18.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 36cecd98cfd006e2b3b044e1433a8914916c98b9
      https://github.com/llvm/llvm-project/commit/36cecd98cfd006e2b3b044e1433a8914916c98b9
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M llvm/lib/Target/Mips/MipsAsmPrinter.cpp
    M llvm/lib/Target/Mips/MipsAsmPrinter.h
    M llvm/test/CodeGen/Mips/Fast-ISel/pr40325.ll
    M llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/jump_table_and_brjt.ll
    M llvm/test/CodeGen/Mips/compactbranches/unsafe-in-forbidden-slot.ll
    M llvm/test/CodeGen/Mips/indirect-jump-hazard/jumptables.ll
    M llvm/test/CodeGen/Mips/jump-table-mul.ll
    M llvm/test/CodeGen/Mips/pseudo-jump-fill.ll

  Log Message:
  -----------
  [MIPS] Use generic isBlockOnlyReachableByFallthrough (#80799)

FastISel may create a redundant BGTZ terminal which fallthroughes.
```
  BGTZ %2:gpr32, %bb.1, implicit-def $at

bb.1.bb1:
; predecessors: %bb.0
```

The `!I->isBarrier()` check in
MipsAsmPrinter::isBlockOnlyReachableByFallthrough
will incorrectly not print a label, leading to a `Undefined temporary
symbol `
error when we try assembling the output assembly file. See the updated
`Fast-ISel/pr40325.ll` and
https://github.com/rust-lang/rust/issues/108835

In addition, the `SwitchInst` condition is too conservative and prints
many unneeded labels (see the updated tests).

Just use the generic isBlockOnlyReachableByFallthrough, updated by
commit 1995b9fead62f2f6c0ad217bd00ce3184f741fdb for SPARC, which also
handles MIPS.

(cherry picked from commit 6b2fd7aed66d592738f26c76caa8fff95e168598)




More information about the All-commits mailing list