This patch prevents GlobalISel from optimizing out redundant branch instructions when compiling without optimizations.
The motivating example is code like the following common pattern in Swift, where users expect to be able to set a breakpoint on the early exit:
public func f(b: Bool) { guard b else { return // I would like to set a breakpoint here. } ... }
The patch modifies two places in GlobalISEL: The first one is in IRTranslator.cpp where the removal of redundant branches is made conditional on the optimization level. The second one is in AArch64InstructionSelector.cpp where an -O0 *only* optimization is being removed.
rdar://79515454
The formatting is off now.