Skip to content

Merge 6b2fd7aed66d592738f26c76caa8fff95e168598 into 18.x #80877

Closed
@brad0

Description

@brad0

[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
rust-lang/rust#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 1995b9f for SPARC, which also
handles MIPS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions