Matthias Krüger 1155f01c5a
Rollup merge of #138073 - tmiasko:inline-asm-critical-edges, r=bjorn3
Break critical edges in inline asm before code generation

An inline asm terminator defines outputs along its target edges -- a
fallthrough target and labeled targets. Code generation implements this
by inserting code directly into the target blocks. This approach works
only if the target blocks don't have other predecessors.

Establish required invariant by extending existing code that breaks
critical edges before code generation.

Fixes #137867.

r? ``@bjorn3``
2025-03-07 10:12:46 +01:00
..
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2025-02-21 21:51:20 -05:00
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2024-09-09 19:39:43 -07:00
2025-02-03 10:39:32 -05:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2024-07-14 13:48:29 +03:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2024-07-14 13:48:29 +03:00
2024-12-10 21:41:05 +01:00
2025-02-24 09:26:54 +00:00
2024-05-31 15:56:43 +10:00
2024-07-14 13:48:29 +03:00
2024-05-31 15:56:43 +10:00
2025-02-24 09:26:54 +00:00
2025-02-24 09:26:54 +00:00
2025-03-02 18:53:49 +00:00
2025-02-24 09:26:54 +00:00
2024-08-07 00:41:48 -04:00
2024-05-31 15:56:43 +10:00
2025-02-19 11:36:52 -08:00
2024-09-09 19:39:43 -07:00

The files here use the LLVM FileCheck framework, documented at https://llvm.org/docs/CommandGuide/FileCheck.html.

One extension worth noting is the use of revisions as custom prefixes for FileCheck. If your codegen test has different behavior based on the chosen target or different compiler flags that you want to exercise, you can use a revisions annotation, like so:

// revisions: aaa bbb
// [bbb] compile-flags: --flags-for-bbb

After specifying those variations, you can write different expected, or explicitly unexpected output by using <prefix>-SAME: and <prefix>-NOT:, like so:

// CHECK: expected code
// aaa-SAME: emitted-only-for-aaa
// aaa-NOT:                        emitted-only-for-bbb
// bbb-NOT:  emitted-only-for-aaa
// bbb-SAME:                       emitted-only-for-bbb