[all-commits] [llvm/llvm-project] 6b2fd7: [MIPS] Use generic isBlockOnlyReachableByFallthrou...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Feb 6 09:23:45 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b2fd7aed66d592738f26c76caa8fff95e168598
      https://github.com/llvm/llvm-project/commit/6b2fd7aed66d592738f26c76caa8fff95e168598
  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.




More information about the All-commits mailing list