llvm-project/llvm/test/CodeGen/Mips/GlobalISel
Adrian Prantl c5d84d2eb3 GlobalISel/AArch64: don't optimize away redundant branches at -O0
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.

Disabling these optimizations increases code size at -O0 by
~8%. However, doing so improves debuggability, and debug builds are
the primary reason why developers compile without optimizations. We
thus concluded that this is the right trade-off.

rdar://79515454

This tenatively reapplies the patch without modifications, the LLDB
test that has blocked this from landing previously has since been
modified to hopefully no longer be sensitive to this change.

Differential Revision: https://reviews.llvm.org/D105238
2021-07-29 16:04:22 -07:00
..
instruction-select CodeGen: Print/parse LLTs in MachineMemOperands 2021-06-30 16:54:13 -04:00
irtranslator GlobalISel: Track argument pointeriness with arg flags 2021-07-15 19:11:40 -04:00
legalizer [MIPS] Regenerate test after D105161. NFC 2021-07-13 07:31:22 +01:00
llvm-ir GlobalISel/AArch64: don't optimize away redundant branches at -O0 2021-07-29 16:04:22 -07:00
mips-prelegalizer-combiner CodeGen: Print/parse LLTs in MachineMemOperands 2021-06-30 16:54:13 -04:00
regbankselect CodeGen: Print/parse LLTs in MachineMemOperands 2021-06-30 16:54:13 -04:00