[llvm] [LoopSimplifyCFG] Add check for missing loop preheader (PR #149743)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 06:57:45 PDT 2025


================
@@ -0,0 +1,16 @@
+; RUN: opt -S -enable-loop-simplifycfg-term-folding=true -passes='require<domtree>,loop(loop-simplifycfg)' -verify-loop-info -verify-dom-info -verify-loop-lcssa < %s | FileCheck %s
+ 
+define void @test() {
+; CHECK-LABEL: @test(
+
+  indirectbr ptr null, [label %A, label %C]
----------------
nikic wrote:

```suggestion
  indirectbr ptr %arg, [label %A, label %C]
```
To avoid making this immediate UB.

https://github.com/llvm/llvm-project/pull/149743


More information about the llvm-commits mailing list